【发布时间】:2015-03-06 09:29:45
【问题描述】:
基于Opening Word document within C# that has spaces in the path。我想问一下如何做同样的事情,但是当从列表框中获取路径时。我知道如果我使用@"path" 它会起作用,但是我如何在打开时对listBox.SelectedItem.ToString() 做同样的事情
var _p = new Process();
_p.StartInfo.FileName = "Word.exe"
_p.StartInfo.Arguments = lbFiles.SelectedItem.ToString();
假设我要打开“C:\new word document.docx”。 Word 给出一个错误找不到路径“C:\new.doc”任何想法如何做到这一点。
【问题讨论】:
-
"Word.exe"仅用于演示文稿,估价器是根据此post从注册表中获取的