On Fri, 23 Mar 2007 13:05:08 -0700, "tshad" <t@home.comwrote:
>In my sample program I have the following:
File.Create(@"c:\newfile.zip")
Why does it use an @ sign?
I don't normally have to do that in my code to open a file.
Thanks,
Tom
Look carefully at your string, it has "\n" in it, which is normally a
newline character. The @ indicates that the string is to be
interpreted literally, without any of the special characters such as
\n, \t etc.
Alternatives are :
File.Create("c:\\newfile.zip")
or
File.Create("c:/newfile.zip")
The first alternative escapes the '\', the second makes use of the
fact that Windows recognises Unix-style filenames with '/' instead of
'\'.
rossum