منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب
تحويل كود C# الى VB.net - نسخة قابلة للطباعة

+- منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب (http://vb4arb.com/vb)
+-- قسم : قسم لغة الفيجوال بيسك VB.NET (http://vb4arb.com/vb/forumdisplay.php?fid=182)
+--- قسم : قسم اسئلة VB.NET (http://vb4arb.com/vb/forumdisplay.php?fid=183)
+--- الموضوع : تحويل كود C# الى VB.net (/showthread.php?tid=3374)



تحويل كود C# الى VB.net - samehfido - 30-06-14

السلام عليكم
لن أطيل عليكم : أريد تحويل هذا الكود


كود :
 var p = new Process
                {
                    StartInfo =
                    {
                        FileName = _scriptEditor,
                        Arguments = String.Format("\"{0}\"", scriptPath)
                    }
                };
 وشكراً


RE: تحويل كود C# الى VB.net - silverlight - 30-06-14

كود :
        Dim _scriptEditor As String = ""
        Dim scriptPath As String = ""
        Dim myProcess = New Process()
        myProcess.StartInfo.FileName = _scriptEditor
        myProcess.StartInfo.Arguments = String.Format("""{0}""", scriptPath)

عليك إعطاء قيمة للممتغيران ف بداية الكود من الأفضل أن تستخدم الكود بالشكل التالي لأنه ربما يحدث خطأ ما أثناء التنفيذ

كود :
       Dim _scriptEditor As String = ""
        Dim scriptPath As String = ""
        Dim myProcess = New Process()
        Try
            myProcess.StartInfo.FileName = _scriptEditor
            myProcess.StartInfo.Arguments = String.Format("""{0}""", scriptPath)

        Catch ex As Exception
        Finally
            ' do something
        End Try



RE: تحويل كود C# الى VB.net - vbnet - 30-06-14

.....

إذا أردت التحويل كما هو
كود :
Dim p As New Process() With {.StartInfo = New ProcessStartInfo() With {.FileName = _scriptEditor, .Arguments = """" & scriptPath & """"}}
.....


RE: تحويل كود C# الى VB.net - samehfido - 01-07-14

جزاكم الله خيراً