R
Ryan Folstad
Hello i have a problem with c# string handling. Hopefully someone can
explain what im doing wrong.
this code:
string windowsdir = "c:\\windows";
string installdir ="c:\\install";
string path= String.Format("{0}\\system32\\cscript.exe {1}\\filename.vbs",
windowsdir, installdir);
The inspector shows:
path = @"c:\windows\system32\cscript.exe c:\install\filename.vbs"
Problem is when i add the escape characters for \" ie:
string path= String.Format("{0}\\system32\\cscript.exe
\"{1}\\filename.vbs\"", windowsdir, installdir);
The inspector now shows:
path = "c:\\windows\\system32\\cscript.exe \"c:\\install\\filename.vbs"
(No @ anymore and the escape sequences don't seem to be applied)
Can anyone explain what is going on here? Do i have the escape sequence for
a double quote wrong? Why is the addition of \" causing all escape
sequences to not seem to be applied?
FYI.. im using .net 1.1 on win2k3.
Thanks,
R
explain what im doing wrong.
this code:
string windowsdir = "c:\\windows";
string installdir ="c:\\install";
string path= String.Format("{0}\\system32\\cscript.exe {1}\\filename.vbs",
windowsdir, installdir);
The inspector shows:
path = @"c:\windows\system32\cscript.exe c:\install\filename.vbs"
Problem is when i add the escape characters for \" ie:
string path= String.Format("{0}\\system32\\cscript.exe
\"{1}\\filename.vbs\"", windowsdir, installdir);
The inspector now shows:
path = "c:\\windows\\system32\\cscript.exe \"c:\\install\\filename.vbs"
(No @ anymore and the escape sequences don't seem to be applied)
Can anyone explain what is going on here? Do i have the escape sequence for
a double quote wrong? Why is the addition of \" causing all escape
sequences to not seem to be applied?
FYI.. im using .net 1.1 on win2k3.
Thanks,
R