Application.ExecutablePath에 대한 문자열 변수를 얻고 일부 인수를 사용하여 ProcessStartInfo를 통해 명령 줄에 변수를 전달합니다. 내 코드는 "ExecutablePath"에 공백이 없으면 작동하지만 C : \ documents and settings \ jsmith \ desktop과 같은 경우 C#이 이스케이프로 공백을 처리하고 명령 줄에서 결과를 얻지 못합니다. . 여기Application.ExecutablePath의 공백 처리
내가 경로를 얻기도
string execName = Application.ExecutablePath;
FileInfo execFileInfo = new FileInfo(execName);
execPath = execFileInfo.DirectoryName;
string lmUtil = @"\lmutil";
lmExec = execPath + lmUtil;
This is the method in which I need to handle quotes in paths
GetLicStats(lmExec + " lmstat -a -c " + licport + "@" + curAdd);
가 어떻게 그것을 공백이 포함 된 경우 lmExec 제대로 처리되었는지 확인 할 수 있습니다 "lmutil"명령을 보낸다 방법이다.
감사를 작동합니다. 다음과 같이 lmexec에 인용 부호를 추가했습니다. GetLicStats ("\" "+"lmExec + "\"lmstat -a -c "+ licport +"@ "+ curAdd); –