vb.net winform exe 接参数

找到如下文件

~\WindowsApplication1\My Project\Application.Designer.vb

 

<Global.System.Diagnostics.DebuggerStepThroughAttribute()> _        

Protected Overrides Sub OnCreateMainForm()

‘添加如下代码

If Me.CommandLineArgs.Count > 0 Then                

MessageBox.Show(Me.CommandLineArgs(0).ToString())            

End If

            Me.MainForm = Global.WindowsApplication1.Form1        

End Sub

 

你可能感兴趣的:(WinForm)