Server.MapPath

I have this line of code that works Intermittently:

Dim filepath As String = Server.MapPath("\emergency_instructions.txt")

When it fails I get, "Failed to map the path '/emergency_instructions.txt'.  I do not understand why it sometimes works.

LVL 1
HLRosenbergerAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Ramkisan JagtapConnect With a Mentor Lead DeveloperCommented:
May be it does not found that file at specified location at that instance. Plz make sure that file is there all every time u execute the code.
0
 
HLRosenbergerAuthor Commented:
Thanks.  I just realized I was one level off as far as the folder.  I need to specify:

"..\emergency_instructions.txt")
0
 
HLRosenbergerAuthor Commented:
Thanks
0
All Courses

From novice to tech pro — start learning today.