Quotation mark in string

眉间皱痕 提交于 2019-11-29 14:28:52

You need to use \".

The debugger shows it as \", since it shows valid string literals.
However, the actual value in the string is ". (You can see this in the Text Visualizer)

In a verbatim string literal (@"..."), you need to use "" instead.

var arguments =  @"-s -c -d > ""somedirectory\some file.txt""";

or

var arguments = "-s -c -d > \"somedirectory\\some file.txt\"";
Patrick Rho
string args = @"-s -c -d > ""somedirectory\some file.txt"""

try that.

for more information, http://msdn.microsoft.com/en-us/library/aa691090%28v=vs.71%29.aspx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!