用c#中的notepad ++打开文件进行阅读

我试着用c#语言用notepad ++打开文件进行阅读。 我用这个命令:

Process myProcess = new Process(); Process.Start("notepad++.exe", @"c:\file name for test.txt"); 

notepad ++无法使用全名打开此文件,

notepad ++将名称缩减为4部分,并返回此消息

c:\ file不存在。创建它?

c:\ name不存在。创建它?

c:\ for不存在。创建它?

c:\ test.txt不存在。创建它?

版本的记事本++:9.4.2

在较新的版本中我没有这个问题,但我需要在所有版本中使用notepad ++。

您缺少文件名周围的引号。

试试这个:

 Process myProcess = new Process(); Process.Start("notepad++.exe", "\"c:\\file name for test.txt\"");