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 数据格式
警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property ‘source‘ to ‘org.eclips
警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property ‘source‘ to ‘org.eclips
107 0
警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property ‘source‘ to ‘org.eclips
|
开发框架 .NET C语言
Global.asax文件说明
Global.asax文件说明
212 0
|
JSON 数据格式
Fiori Launchpad server side config json
Fiori Launchpad server side config json
121 0
Fiori Launchpad server side config json
|
Apache
解决办法:Cannot find the class file for org.apache.http.client.ClientProtocolException
解决办法:Cannot find the class file for org.apache.http.client.ClientProtocolException
370 0
|
SQL 网络协议 测试技术
SQL Server使用侦听器IP访问时遇到"The target principal name is incorrect. Cannot generate SSPI context"
原文:SQL Server使用侦听器IP访问时遇到"The target principal name is incorrect. Cannot generate SSPI context" 在测试SQL Server 2016 Always On时,在创建侦听器后,在客户端使用SSMS, 可以用侦...
1871 0