2012-02-16 121 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