Click here to Skip to main content
15,867,835 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
how to change this path C:\Windows\SHELLNEW\EXCEL12.XLSX to this path C:\\Windows\\SHELLNEW\\EXCEL12.XLSX
Posted
Comments
Jibesh 29-Jan-13 1:44am    
but why you need? if you can post your problem you may get a better solution for your real problem.

U can do like this

string newpath =@"C:\Windows\SHELLNEW\EXCEL12.XLSX";
 
Share this answer
 
If you plan to use the path at runtime you don't need the extra '\' in the path names.

If you are typing in code then just add the '\' yourself since it is an escape code for c#. or you can use the '@' character :
C#
string path = @"C:\Windows\SHELLNEW\EXCEL12.XLSX";
 
Share this answer
 
if you want to change at run time then try this
C#
string path="C:\Windows\SHELLNEW\EXCEL12.XLSX";
path=path.Replace("\", "\\");
 
Share this answer
 
Comments
Marco Bertschi 21-Feb-13 16:56pm    
My 2. Very inefficient.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900