using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;//命名控件
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Process.Start(@"C:\Documents and Settings\Administrator\桌面\System.txt");// 路径中带有反斜杠 要加 “@”
}
}
}
C# 打开指定的程序或文件
最新推荐文章于 2022-08-25 15:09:00 发布
本文介绍了一个简单的C#应用程序示例,演示了如何使用Process类启动外部程序。通过具体的代码片段,读者可以了解如何指定带特殊字符的文件路径,并正确地调用外部文件。
8680

被折叠的 条评论
为什么被折叠?



