点击一个按钮 - >启动* .exe文件 [英] Click a button --> Launch a *.exe file

查看:228
本文介绍了点击一个按钮 - >启动* .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.

这篇关于点击一个按钮 - >启动* .exe文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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