i am using this to create a new folder
System.IO.Directory.CreateDirectory(@" + somevariable);
the thing is that when i enter the folder c:\newfolder\newfolder in the textbox and is trying to recieve the value up in the controller it is replaced with double slash( \) c:\\newfolder\\newfolder. how would i prevent \ quotes from coming in the path
Secondly the string.replace is also not working for replacing \ with \\
string strText = OrganMeta.vcr_MetaValue;
string gf = strText.Replace("\\", @"\");
“\\” is equivalent to a string of one character, a backslash.
@”\” is also equivalent to a single character, a backslash.
so your Replace method is replacing one form of a backslash with a different form.
try this:
OR
as far as the folder thing goes, Andy is right, it will show a double-backslash in the IDE when in fact there is only one in the string. is there an error when Directory.CreateDirectory() is called? or is the folder created?