vb.net - 如何启动带参数的exe

标签 vb.net exec parameter-passing

我是 Visual Basic 新手。我正在使用 VB Premium 2012。 有没有一种方法可以使用参数打开/启动 exe 文件(不是我的应用程序)。我知道我们可以使用 echo 和其他东西在批量编码中完成。可以用vb做吗?

我想打开“app.exe”,参数为“-login usernamehere passwordhere

最佳答案

试试这个

Dim pHelp As New ProcessStartInfo
pHelp.FileName = "YourApplication.exe"
pHelp.Arguments = "parameter1,parameter2"
pHelp.UseShellExecute = True
pHelp.WindowStyle = ProcessWindowStyle.Normal
Dim proc As Process = Process.Start(pHelp)

希望对你有帮助...

关于vb.net - 如何启动带参数的exe,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12684915/

相关文章:

bash:强制 exec 进程具有无缓冲的标准输出

vb.net - "Programs and Features"Win 应用程序的图标(使用 ClickOnce 部署)

wpf - 如何将 RestClient 与 Oauth 2.0 和客户端 + TLS 证书一起使用?

asp.net - 从用户控件访问父页面属性

c - 如何使用 execlp 将命令行参数传递给 C 程序

c - multi-pipe() C 程序中的无限循环

c - 将 char* 传递给结合 memcpy 的函数

flutter - 将值传递给要在底部工作表中使用的 float 操作按钮

xml - 使用VB.Net解析复杂的xml : elements into strings depending on namespace

c++ - 通过引用和值传递