Open a file with Notepad in C#

前端 未结 6 597
春和景丽
春和景丽 2020-11-28 06:35

How I open a file in c#? I don\'t mean reading it by textreader and readline(). I mean open it as an independent file in notepad.

6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-28 06:43

    You can use Process.Start, calling notepad.exe with the file as a parameter.

     Process.Start(@"notepad.exe", pathToFile);
    

提交回复
热议问题