How can I use Server.MapPath() from global.asax?

简介: //引用:using System.Web.Hosting; string filePathcsv = ""; string file = ""; string strFile = "LukfookGeovindu"; strFile = strFile + Da
            //引用:using System.Web.Hosting;
            string filePathcsv = "";
            string file = "";
            string strFile = "LukfookGeovindu";
            strFile = strFile + DateTime.Now.ToString("yyyyMMddhhmmss");
            strFile = strFile + ".csv";
            //file = strFile; 
            //file = HttpContext.Current.Server.MapPath("/ReportExcel/" + strFile); //此用法存在問題
            // Server.MapPath("/ReportExcel/" + strFile);//存在問題
            file = HostingEnvironment.MapPath("/ReportExcel/" + strFile);

目录
相关文章
org.activiti.engine.ActivitiException: Couldn't deserialize object in variable 'application'
org.activiti.engine.ActivitiException: Couldn't deserialize object in variable 'application'
|
XML Java 应用服务中间件
org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 18
org.apache.tomcat.util.bcel.classfile.ClassFormatException: Invalid byte tag in constant pool: 18
307 0
|
XML 数据格式
警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property ‘source‘ to ‘org.eclips
警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property ‘source‘ to ‘org.eclips
118 0
警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property ‘source‘ to ‘org.eclips
|
XML 应用服务中间件 Android开发
解决方案:Tomcat警告 [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property ‘source‘
解决方案:Tomcat警告 [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property ‘source‘
解决方案:Tomcat警告 [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property ‘source‘
安装baostock插件报错ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read t
安装baostock插件报错ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read t
440 0
|
开发框架 .NET C语言
Global.asax文件说明
Global.asax文件说明
230 0
|
Apache
解决办法:Cannot find the class file for org.apache.http.client.ClientProtocolException
解决办法:Cannot find the class file for org.apache.http.client.ClientProtocolException
396 0
|
Android开发
The type org.apache.http.NameValuePair cannot be resolved. It is indirectly referenced from requi...
eclipse莫名其妙的bug 解决方案如下,把编译的android版本调低就可以了 调低编译版本
1646 0

热门文章

最新文章