日期:2014-05-17  浏览次数:20886 次

求助C#添加文件的问题
string path = @"E:\软件\c#\MyMapFrame\帮助文档.txt";
            System.Diagnostics.Process.Start(path);
用这个可以打开文件,但是当我路径改了之后就打不开了。各位大神指教一个不需要路径就能打开的方法。

------解决方案--------------------
楼主要的应该是启动记事本的功能,可以看下面的代码:

 #region [ 启动记事本 ]

    System.Diagnostics.Process Proc;

    try
    {
        // 启动记事本
        Proc = new System.Diagnostics.Process();
        Proc.StartInfo.FileName = "notepad.exe";
        Proc.StartInfo.UseShellExecute = false;
        Proc.StartInfo.RedirectStandardInput = true;
        Proc.StartInfo.RedirectStandardOutput = true;

        Proc.Start();
    }