Dumb question.. is this c# code intended to read local client files?
System.IO.FileStream content = System.IO.File.Open("c:\test.txt", System.IO.FileMode.Open);
It gives me error FILE NOT FOUND
I'm running Windows 7 and IE 8.
Dumb question.. is this c# code intended to read local client files?
System.IO.FileStream content = System.IO.File.Open("c:\test.txt", System.IO.FileMode.Open);
It gives me error FILE NOT FOUND
I'm running Windows 7 and IE 8.
you forgot @ before "
System.IO.FileStream content = System.IO.File.Open(@"c:\test.txt", System.IO.FileMode.Open);
ofcourse you can do in this way:
System.IO.FileStream content = System.IO.File.Open("c:\\test.txt", System.IO.FileMode.Open);
Having \ by itself means an escape character. You need to either use @ or double \
System.IO.FileStream content = System.IO.File.Open(@"c:\test.txt", System.IO.FileMode.Open);
or
System.IO.FileStream content = System.IO.File.Open("c:\\test.txt", System.IO.FileMode.Open);
If both fails..Check your NTFS permissions on the file.