Hello i have a problem with c# string handling. Hopefully someone can
explain what im doing wrong.
this code:
string windowsdir = "c:\\window s";
string installdir ="c:\\instal l";
string path= String.Format(" {0}\\system32\\ cscript.exe {1}\\filename.v bs",
windowsdir, installdir);
The inspector shows:
path = @"c:\windows\sy stem32\cscript. exe c:\install\file name.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\\s ystem32\\cscrip t.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:\\window s";
string installdir ="c:\\instal l";
string path= String.Format(" {0}\\system32\\ cscript.exe {1}\\filename.v bs",
windowsdir, installdir);
The inspector shows:
path = @"c:\windows\sy stem32\cscript. exe c:\install\file name.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\\s ystem32\\cscrip t.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
Comment