C# – Illegal characters in path

Whether you do this

String Filepath = @"C:\Temp\My Excel File.xls";

or this

String Filepath = "C:\\Temp\\My Excel File.xls";

the string stored in memory is just C:\Temp\My Excel File.xls, whatever the debugger may tell you. So when you read some string from somewhere (database, file, user input, …) you don’t need to “escape” backslashes. So just use that string.