如何创建一个消息框来打开3个exe文件? [英] How can i create a message box to open 3 exe files?
问题描述
所以我在DVD上有3个.EXE文件,我想创建一个自动运行,打开一个脚本来选择.EXE,例如:
so i have 3 .EXE files on a dvd, and i want to make an autorun that opens a script to select the .EXE's, for example:
tristanceleazer。 000webhostapp.com/MSG.png
tristanceleazer.000webhostapp.com/MSG.png
(不要使用WWW。)
推荐答案
请使用 Process.Start(< exe文件名>),如下所示
Hi,
Please use Process.Start(<exe file name>) like this
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Diagnostics;
namespace ExecuteExeFile
{
public partial class FormMain : Form
{
public FormMain()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Process.Start("notepad.exe");
}
private void button2_Click(object sender, EventArgs e)
{
Process.Start("notepad.exe", @"C:\Windows\system.ini");
}
}
}
[注意]
如果您的应用程序被许多人使用,CD / DVD驱动器的驱动器号将会有所不同。
我想您将编写包含光驱驱动器号的代码。请记住检查用户环境中的驱动器号是什么。
$
问候,
[note]
If your application is used many people, drive letter of CD/DVD drive would be varied.
I suppose you will write code that includes drive letter of optical drive. Please remember to check what is a drive letter in users environment.
Regards,
这篇关于如何创建一个消息框来打开3个exe文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!