Author: parcheggio | Posted on: 3/20/2009 6:36:14 PM | Views : 287

I am using VS.NET 2008 and I created a new website.  I want to include a text file in the website and I want one of the pages to read from the file using the following code:

Dim objReader As IO.StreamReader
Dim strFileName As String = "\Datafile.txt"
Dim strLocationAndNameOfFile As String = Directory.GetCurrentDirectory() & strFileName
If IO.File.Exists(strLocationAndNameOfFile) = True Then objReader = IO.File.OpenText(strLocationAndNameOfFile)

This works if I put the file on my local C:\ drive which won't work for the Web environment.  How can this file be referenced?  Can I configure the web.config file to locate this file?
...

Go to the complete details ...