Is there another way of assigning string path to variable aside from this:
strPath = @"C:\Myfile.txt";
- is there another way instead using "@" sign in the string path.
thanks.
Do you mean another way of escaping the backslashes?
The @ sign at the start means that the string is treated as a verbatim string literal, and simple escape sequences such as \n or \t are ignored.
If you don't put the @ at the start it is not verbatim, and escape sequences are parsed. If you want to ignore an individual escape sequence you can precede it with a single backslash and it will be ignored.
The reason you would use it in a path such as your example is so that you don't have to escape each individual backslash as you would if you didn't put the @ at the start:
strPath = "C:\\Myfile.txt";
@sign?@sign has nothing to do with your problem; this question is irrelevant. You should ask a separate question about the exception.