添加命令行参数VB.Net应用命令行、参数、Net、VB

2023-09-03 01:28:07 作者:/

我有一个基于Windows窗体应用程序由另一个程序员量身定做的,我需要添加一些命令行开关,以它的主输出的exe ,这样我可以通过类似的参数:

PROGRAM.EXE -reinitialise PROGRAM.EXE -sync

我已经发现了一些文档在线,但似乎都在C#和对于命令行只计划。

此程序通过一个.msi安装和.exe文件只建造在最后。

所以,我的问题是:

我如何添加命令行切换到VB.Net应用程序?

在哪里/我添加什么样的形式解析器,使主输出的.exe接受的args?

解决方案

类似于C / C#,你让他们作为一个数组。从C / C#不同的是,您获得它们作为应用程序本身的只读属性(My.Application.CommandlineArgs)

http://msdn.microsoft.com/en-us/library/z2d603cy(v=vs.80).aspx#Y550

在该网页上code试样(VB)应该告诉你你需要什么,我认为...

I have a windows forms based application made by another programmer and I need to add a few command line switches to it's primary output exe so that I can pass arguments like:

VB.NET程序打包

program.exe -reinitialise or program.exe -sync

I have found some docs online but all seem to be in C# and are for command line only programs.

This program installs via an .msi and the .exe is only constructed at the end.

So my questions are:

How do I add command line switches to a VB.Net application?

Where/What form do I add the parser to so that the primary output .exe accepts the args?

解决方案

Similar to C/C#, you get them as an array. Different from C/C#, you obtain them as a read-only property from the application itself (My.Application.CommandlineArgs)

http://msdn.microsoft.com/en-us/library/z2d603cy(v=vs.80).aspx#Y550

Code sample on that page (for VB) should show you what you need i think...