I am making a VB.NET web application in VS.NET 2003.
I am using streamreader to access a text file for reading. I am able to access it without any problems using the full path (ie. C:\Inetpub\wwwroot\<projectname>\bin\file.txt). But I want to use a relative path (ie. .\file.txt).
If I use something like:
Dim sr As System.IO.StreamReader
sr = New StreamReader(".\file.txt") 'or just "file.txt"
I get the following error:
Could not find file "c:\windows\system32\inetsrv\file.txt".
Source Error:
Line 62: sr = New StreamReader(".\file.txt")
Why does it automatically default to the directory "c:\windows\system32\inetsrv\"?
What should I do to change this?