Getting just \ in a C# string, escape sequence problem

  • Thread starter Thread starter chasgl
  • Start date Start date
C

chasgl

I am using Visual Studio 2009 creating a c# program. I want to create a
string c:\GoToWebSite.aspx when I try to do it this way :
string FileStr = “c:\GoToWebSite.aspx". I get an error message
Error 3 Unrecognized escape sequence When I try FileStr =
“c:\\GoToWebSite.aspx". The resulting string is c:\\GoToWebSite.aspx. . When
I try FileStr = @“c:\GoToWebSite.aspx.†the resulting string is =
c:\\GoToWebSite. How do I just get c:\GotoWebSite.aspx?
 
Thanks, Also sorry about the duplicate posts, I was getting messages that the
post hadn't been posted.
 
Back
Top