asp.net中文件的路径

mac2022-06-30  36

/*********************************************************************************   **  IIS homedirctory在c:\inetpub\wwwroot         **   **  虚拟目录在E:\WebApplication10.           **   **  目前的程序在E:\WebApplication10\tmp文件夹下的一个页面.     **   *********************************************************************************/   string str = Server.MapPath("~/languages.xml");   //str=E:\WebApplication10\languages.xml

   string str1 = Server.MapPath("./languages.xml");   //str1=E:\WebApplication10\tmp\languages.xml

   string str2 = Server.MapPath("../languages.xml");   //str2=E:\WebApplication10\languages.xml

   string str3 = Server.MapPath("mm/languages.xml");   //str3=E:\WebApplication10\tmp\mm\languages.xml

   string str4 = Server.MapPath("/mm/languages.xml");   //str4=c:\inetpub\wwwroot\mm\languages.xml

转载于:https://www.cnblogs.com/Elong/archive/2005/06/20/177771.html

相关资源:asp.net 获取路径的几种方式
最新回复(0)