当前位置:编程学习 > C#/ASP.NET >>

类型“System.Web.HttpContext”中不存在类型名称“Current”

我已经添加了System.WEB引用
并且在CS文件中也添了using
using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;
using System.Data;
using System.IO;
using System.Configuration;
using System.Web.HttpContext.Current.Server.MapPath;





代码是        public static void FileDel(string bigurl,string smallurl)//删除作品(服务器端)
        {
            string strFileUploadPath = ConfigurationManager.AppSettings["FileUploadPath"].ToString();
            
            string strFileUploadPath1= Server.MapPath(strFileUploadPath + bigurl);
            string strFileUploadPath2 = Server.MapPath(strFileUploadPath + smallurl);
            File.Delete(strFileUploadPath1);
            File.Delete(strFileUploadPath2);
        }

为什么还会出现这个错误???? --------------------编程问答-------------------- using System.Web.HttpContext.Current.Server.MapPath 改為
using System.Web
补充:.NET技术 ,  ASP.NET
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,