在表单加载时,您可以从Environment.CommandLine
. 但是,当我再次打开单实例应用程序时使用应用程序事件来检测命令行字符串时,我找不到 in 的等价Environment.CommandLine
物StartupNextInstanceEventArgs
。
这是我的代码:
Private Sub MyApplication_StartupNextInstance( _
ByVal sender As Object, _
ByVal e As Microsoft.VisualBasic.ApplicationServices.StartupNextInstanceEventArgs _
) Handles Me.StartupNextInstance
'I can only use e.CommandLine which returns a readonlycollection, not a string like Environment.CommandLine does. Can someone help me out?
End Sub