简体   繁体   English

visual basic 2010中的参数

[英]parameters in visual basic 2010

how can use parameters in my vb application? 如何在我的vb应用程序中使用参数?

i want to make it so that when the parameter its "/y" i want some thing like this to hapen 我想这样做,以便当参数“/ y”我希望这样的东西成为hapen时

if parameter = "/y" then 
    msgbox("you used the parameter /y")
else
    msgbox("you dint use any parameter")
end if

i want some thing like this to hapen when i use the parameter "/y" the parameters are used when for ex: im running the .exe on cmd 我想要这样的事情,当我使用参数“/ y”时,参数被用于ex:im在cmd上运行.exe

You can change Sub Main() to 您可以将Sub Main()更改为

Sub Main(ByVal cmdArgs() As String) 

And use the argument array that way. 并以这种方式使用参数数组。 This has been valid in VB.NET for many versions. 这在VB.NET中对许多版本都有效。

The passed in command line arguments will be available to the Main procedure of your application. 传入的命令行参数将可用于应用程序的Main过程

These come in as an array of strings. 它们以字符串数组形式出现。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM