Hi, I got a similar problem just now. On my local machine I mapped th
V:\LoggerNet to a remote server folder where the real-time data com
in. I checked the file, it gets updated with the original serve
source. The code is like
streamreader sr=null;
sr = File.OpenText("V:\\LoggerNet\\newdata.dat");
text = sr.ReadToEnd();
But when I run the code, it gave error "Could not find a part of th
path "V:\LoggerNet\newdata.dat" on my webpage.
Do you have any idea why this happen?? Thanks a lot!
Jessica
[MSFT] wrote:
*Hello,
Request.ApplicationPath will return a virtual path string like
"/WebApplication1". However, StreamReader require a physical pat
like
"C:\inetpub\webapplication1\sample.txt". To convert a virtual pat
to
physical path, we can use MapPath method:
MyFile =Server.MapPath(Request.ApplicationPath + "//sample1.txt");
Hope this help,
Luke
Microsoft Online Support
Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confer
no
rights.)
-
jessic
-----------------------------------------------------------------------
Posted via
http://www.codecomments.co
-----------------------------------------------------------------------