1private void button1_Click(object sender, System.EventArgs e)
2
{
3
string strFilePath = Application.StartupPath +@"/TextFile1.txt";
4
MessageBox.Show(strFilePath);
5
System.Diagnostics.Process.Start(strFilePath);
6
}
7
8
private void button2_Click(object sender, System.EventArgs e)
9
{
10
string strFilePath = Application.StartupPath +@"/HTMLPage1.htm";
11
MessageBox.Show(strFilePath);
12
System.Diagnostics.Process.Start(strFilePath);
13
}

3

4

5

6

7

8

9

10

11

12

13

另外还有两个简单的运用,简直是高效率的写程序,舒坦。如果我们的程序是关于注册表操作或者说系统优化之类的,那么可以做得更加愉快。
1
System.Diagnostics.Process.Start("shutdown",@"/l");//------------注销计算机
2
System.Diagnostics.Process.Start("shutdown",@"/r");//------------重起计算机

2
