在运行时传递参数(使用命令提示符) [英] Passing parameters at run time(using command prompt)

查看:113
本文介绍了在运行时传递参数(使用命令提示符)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我是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 the Main of your application, you can add a args parameter:
Private Shared Sub Main(args As String())
	' now, args(0) contains the first argument, args(1) the second argument,...
End Sub


这篇关于在运行时传递参数(使用命令提示符)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆