How to access the relative directory of a ASP.NET website?

Posted by Michael Schilling on Stack Overflow See other posts from Stack Overflow or by Michael Schilling
Published on 2012-03-28T23:27:09Z Indexed on 2012/03/28 23:29 UTC
Read the original article Hit count: 244

I need to access a folder that will contain various text files for my web site. I'm using Visual Web Developer 2010 Express. I made a web site using visual basic. Here is the failing code:


Dim fileName As String
fileName = CurDir.ToString + fileName.Text + ".txt" 
FileOpen(1, fileName, OpenMode.Output)
FileClose(1)

CurDir.ToString is giving me strange directory path that isn't anywhere near where my website files are located. I need to be able to access the files in a folder inside of the WebSite1 folder without using C:\Users\..., but I'm at a loss on how to do that. Can anyone help me out?

© Stack Overflow or respective owner

Related posts about homework

Related posts about vba