点击一个按钮 - >启动* .exe文件

问题描述:

基本上,我想要做的是推出一个* .exe文件,当我点击一个按钮。我想在VB.NET这件事。我有Microsoft Visual Basic 2008中前preSS版。

Basically, what I want to do is launch an *.exe file when I click on a button. I want this done in VB.NET. I have Microsoft Visual Basic 2008 Express Edition.

按钮我有被称为btnYES。

The button I have is called 'btnYES'.

我怎样才能从这个按钮的点击启动一个* .exe文件?

How can I launch an *.exe file from the click of this button?

在按钮调用的事件处理程序

In the event handler of the button call

Process.Start("C:\path_to\myapp.exe")

您会发现MSDN文档中进一步样品 的Process.Start()

You will find further samples in the MSDN documentation for Process.Start().

如果你不知道一个事件处理程序是如何创建的:只要在设计器中打开表单并在 btnYes 按钮双击。这将自动为按钮单击事件创建一个事件处理程序和IDE将打开code文件为你在正确的位置上。

In case you don't know how an event handler is created: Simply open the form in the designer and double-click on the btnYes button. This will automatically create an event handler for the button click event and the IDE will open the code file for you at the correct position.