How to use Server.MapPath to get location outside website folder in ASP.NET

前端 未结 4 1696
没有蜡笔的小新
没有蜡笔的小新 2020-12-06 10:53

When my ASP.NET site uses documents (e.g. XML), I normally load the document as follows:

Server.MapPath(\"~\\Documents\\MyDocument.xml\")

H

4条回答
  •  一个人的身影
    2020-12-06 11:40

    If you want to specify the Location somewhere in harddrive , then its is not easily available on web environment. If files are smaller in size and quantity then you can keep it inside directory and point then using ~/path till directory.

    But in some cases we used to do Request object. For more visit this link

    http://msdn.microsoft.com/en-us/library/5d5940ad.aspx

提交回复
热议问题