منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب

نسخة كاملة : تحويل كود C# الى VB.net
أنت حالياً تتصفح نسخة خفيفة من المنتدى . مشاهدة نسخة كاملة مع جميع الأشكال الجمالية .
السلام عليكم
لن أطيل عليكم : أريد تحويل هذا الكود


كود :
 var p = new Process
                {
                    StartInfo =
                    {
                        FileName = _scriptEditor,
                        Arguments = String.Format("\"{0}\"", scriptPath)
                    }
                };
 وشكراً
كود :
        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
.....

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