且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在WPF应用程序中使用process.start调用另一个WPF应用程序

更新时间:2023-11-22 17:57:58

我发现了一个网页,该网页显示了从C#转换为VB.Net的版本. http://www.vbdotnetheaven.com/uploadfile/mahesh/access -command-line-arguments-in-VB-Net/ [
I found a web page that showed a version that was converted from C# to VB.Net
http://www.vbdotnetheaven.com/uploadfile/mahesh/access-command-line-arguments-in-VB-Net/[^]

Ive tried this in VB.Net and it works

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    Dim psnfo As String
    Dim strbuilder As New StringBuilder
    Dim arg As String
    For Each arg In Environment.GetCommandLineArgs()
        strbuilder.AppendLine(arg)
    Next
    psnfo = strbuilder.ToString
    TextBox1.Text = "Args: " & psnfo.ToString
End Sub



代码返回:
Args:C:\ Testapp1.exe
temp

它将返回传递给它的两个参数.

您的代码似乎没有将args视为数组或一组项目.
希望对您有所帮助.



The code returns:
Args: C:\Testapp1.exe
temp

It will return both args passed to it.

your code does not appear to treat the args as an array or group of items.
Hope this helps some.