在 VB.NET 代码隐藏中运行 .exe 文件 onload

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/16465322/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-17 13:33:09  来源:igfitidea点击:

run an .exe file onload in VB.NET codebehind

vb.netexebehind

提问by D-Dawgg

i have song data (title and artist) that display on a web page. I would like to display this info on a twitter account and have found this great twitter .exe file that will tweet what ever i want to the twitter account. How do i simply run an .exe file from the code behind page to execute this twt.exe file?

我有显示在网页上的歌曲数据(标题和艺术家)。我想在 Twitter 帐户上显示此信息,并找到了这个很棒的 twitter .exe 文件,它可以向 Twitter 帐户发送我想要的任何内容。我如何简单地从代码隐藏页面运行一个 .exe 文件来执行这个 twt.exe 文件?

回答by Darin Dimitrov

You could use the Process.Startmethod:

您可以使用以下Process.Start方法:

Process.Start("c:\somepath\twt.exe")

and if you wanted to pass arguments:

如果你想传递参数:

Process.Start("c:\somepath\twt.exe", "arg1 arg2 arg3 ...")

Or even better, take a look at the Twitter OAuth developer pageand directly use their public API.

或者更好的是,查看Twitter OAuth developer page并直接使用他们的公共 API。