2012-02-16 126 views
0

我想將以下代碼轉換爲vb.net,但在線轉換器返回錯誤。請任何身體幫忙嗎?無法將代碼轉換爲vb.net,請求幫助

JohnKenedy.BusinessSQLEXPRInstaller _ins = new JohnKenedy.BusinessSQLEXPRInstaller(
    "<Installation Display Name>", "localhost", 
    "<New database instance name>", "<new database name>", "<database password>", 
    "<database backup filename>"); 

if (_ins.IsDone == false) _ins.ShowDialog(); 
if (_ins.IsRestart == true) 
{ 
    Application.Exit(); 
    this.Close(); 
    return; 
} 
+0

它產生了什麼代碼,是什麼錯誤? – 2012-02-16 16:34:38

回答

4

爲什麼值得這些代碼轉換器通常希望你有一個類中的代碼,而不僅僅是一些代碼存根。

Dim _ins as JohnKenedy.BusinessSQLEXPRInstaller = New JohnKenedy.BusinessSQLEXPRInstaller("<Installation Display Name>", "localhost", "<New database instance name>", "<new database name>", "<database password>", "<database backup filename>") 
    If _ins.IsDone = False Then _ins.ShowDialog() 
    If _ins.IsRestart = True Then 
     Application.Exit() 
     Me.Close() 
    End If 
+0

如果你想轉換return語句,如果封閉方法是一個Sub(C#中的void)或Exit函數,如果封閉方法是一個Function(返回一個值的方法),則使用'Exit Sub'。 – avanek 2012-02-16 16:36:24

+1

@AshBurlaczenko:不,首先如果在一行中,那麼不需要End If。 – 2012-02-16 16:37:19

+0

謝謝.....你可以提供一下建議JohnKenedy.BusinessSQLEXPRInstaller是什麼?以及如何添加它? – 2012-02-17 14:12:48