コンソール アプリケーションの初心者です。Web アプリケーションからコンソール アプリケーションに 2 つのコマンド ライン引数を渡し、コンソール アプリケーションから返された結果を取得する必要があります。
ここで私は私たちで試しました
Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim proc = New Process() With { _
.StartInfo = New ProcessStartInfo() With { _
.FileName = "C:\Users\Arun\Documents\visual studio 2012\Projects\ConsoleApplication1\ConsoleApplication1\bin\Debug\ConsoleApplication1.exe", _
.Arguments = TextBox1.Text & " " & TextBox2.Text, _
.UseShellExecute = False, _
.RedirectStandardOutput = True, _
.CreateNoWindow = True _
} _
}
proc.Start()
proc.WaitForExit()
Response.Write(proc.ExitCode.ToString())
End Sub
私のコンソールアプリケーションコードは
Public Function Main(sArgs As String()) As Integer
Return sArgs(0)
End Function
しかし、コンソール アプリから戻り値を取得できません。だれかが助けてくれる問題は何ですか?