日期:2014-05-18  浏览次数:20877 次

C# 显示txt文件的内容
我想实现:单击button按钮,相当于用鼠标双击一个txt文件一样,直接将文件打开显示文件内容,不需要textBox控件显示,就是单纯的相当于我们平时用鼠标双击一个txt文件打开一样。请高手指教,谢谢~

------解决方案--------------------
System.Diagnostics.Process.Start("xx.txt")
------解决方案--------------------
using System.Diagnostics
C# code

            Process p = new Process();
            p.StartInfo.FileName = "notepad.exe";
            p.StartInfo.Arguments = "c:\\1.txt";
            p.Start();