Reading text file
-
Want to read file of mine extension ie. "abc.ba" either from web or from local drive. problem is how to set path of file wat i tried is : fp = File.OpenText(Server.MapPath(("C://Upload//") + "test.RA")); fp = File.OpenText(Server.MapPath(("C:\\Upload\\") + "test.RA")); fp = File.OpenText(Server.MapPath((".\\Upload\\") + "test.RA")); Everytime an error message come "VIRTUAL PATH NOT FOUND" wat to do???
-
Want to read file of mine extension ie. "abc.ba" either from web or from local drive. problem is how to set path of file wat i tried is : fp = File.OpenText(Server.MapPath(("C://Upload//") + "test.RA")); fp = File.OpenText(Server.MapPath(("C:\\Upload\\") + "test.RA")); fp = File.OpenText(Server.MapPath((".\\Upload\\") + "test.RA")); Everytime an error message come "VIRTUAL PATH NOT FOUND" wat to do???
-
Want to read file of mine extension ie. "abc.ba" either from web or from local drive. problem is how to set path of file wat i tried is : fp = File.OpenText(Server.MapPath(("C://Upload//") + "test.RA")); fp = File.OpenText(Server.MapPath(("C:\\Upload\\") + "test.RA")); fp = File.OpenText(Server.MapPath((".\\Upload\\") + "test.RA")); Everytime an error message come "VIRTUAL PATH NOT FOUND" wat to do???
-
Just try to map a virtual directory to the folder and access the virtual directory.
Either you love IT or leave IT...
I tried that too but same message.
-
try
fp = File.OpenText(Server.MapPath(("~\\Upload\\") + "test.RA"));
I Love T-SQL "Don't torture yourself,let the life to do it for you." If my post helps you kindly save my time by voting my post.
message {"Could not find a part of the path 'C:\\Documents and Settings\\SJ\\My Documents\\Visual Studio 2005\\WebSites\\Results\\Upload\\test.ra'."} and my file is at c:\upload\test.ra
-
message {"Could not find a part of the path 'C:\\Documents and Settings\\SJ\\My Documents\\Visual Studio 2005\\WebSites\\Results\\Upload\\test.ra'."} and my file is at c:\upload\test.ra