在运行时传递参数(使用命令提示符) [英] Passing parameters at run time(using command prompt)
问题描述
我是vb的新手.我知道c#,核心java..etc但是我现在想学习 Vb .
谁能告诉我如何获取从命令行传递到vb表单的参数.
例如:我在vb中创建了一个ActiveX exe,并在命令提示符下调用了该exe.
c:Test \ cry.exe你好,我叫PK
我的问题是如何分隔或拆分 string("HELLO My name is PK")并存储在数组中.我该如何通过forloop.
请任何人帮助.....
还请告诉我 Interaction.Command $ 和 Command 之间的区别.
HI there,
I am new to vb. I know c#,core java..etc. But i want to learn Vb now.
Can anybody tell me how to fetch parameters which have been passed from commandline to a vb form.
Ex: I created a ActiveX exe in vb and i called that exe in command prompt.
c: Test\cry.exe HELLO My name is PK
My question is how can i seperate or split the string("HELLO My name is PK") and store in an array. how can i pass the forloop for it.
Please anybody help.....
Also please tell me the difference between Interaction.Command$ and Command.
推荐答案
和命令.
我已经回答了您的第一个问题.
在应用程序的Main
中,可以添加args
参数:
I''ve a answer to your first question.
In theMain
of your application, you can add aargs
parameter:
Private Shared Sub Main(args As String())
' now, args(0) contains the first argument, args(1) the second argument,...
End Sub
这篇关于在运行时传递参数(使用命令提示符)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!