Having ASP.Net find a .txt file

VonEhle

Active member
Joined
Feb 20, 2006
Messages
26
Programming Experience
Beginner
I put some .txt files in the App_Data folder of my ASP.Net solution. How can I direct the stream reader to look for the files in this folder (or even the bin if necessary). I don't want to have to use an OpenFileDialog.
 
Map the virtual relative application path to full physical path with the MapPath function.
VB.NET:
[SIZE=2][COLOR=#0000ff]Dim[/COLOR][/SIZE][SIZE=2] fullpath [/SIZE][SIZE=2][COLOR=#0000ff]As [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]String[/COLOR][/SIZE][SIZE=2] = Server.MapPath([/SIZE][SIZE=2][COLOR=#800000]"App_Data/Document.txt"[/COLOR][/SIZE][SIZE=2])[/SIZE]
 
Back
Top