Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/vb.net/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Vb.net .exe中包含多个可能的条目_Vb.net_Batch File_Main - Fatal编程技术网

Vb.net .exe中包含多个可能的条目

Vb.net .exe中包含多个可能的条目,vb.net,batch-file,main,Vb.net,Batch File,Main,我有一个VB.NET程序,在正常使用中显示欢迎窗体并执行它所做的任何操作,但它也应该可以在绕过窗体的模式下从批处理中调用。 我试过: 该批: MyProgram.exe "YES" 表单显示…要获取从命令行发送的参数,您需要使用以下命令,然后适当地使用。您发送的YES参数是string,因此在检索它的属性时,请确保将其转换为布尔CBoolarg 谢谢很好! MyProgram.exe "YES" If Environment.GetCommandLineArgs.Length > 1

我有一个VB.NET程序,在正常使用中显示欢迎窗体并执行它所做的任何操作,但它也应该可以在绕过窗体的模式下从批处理中调用。 我试过:

该批:

MyProgram.exe "YES"

表单显示…

要获取从命令行发送的参数,您需要使用以下命令,然后适当地使用。您发送的YES参数是string,因此在检索它的属性时,请确保将其转换为布尔CBoolarg


谢谢很好!
MyProgram.exe "YES"
If Environment.GetCommandLineArgs.Length > 1 Then
        ' Loop and find each argument
        For Each arg In Environment.GetCommandLineArgs

            If arg.ToString = "yes" Then 
                 'Do stuff here
             End If
        Next
End If