百科学堂 | 实用工具

App_Code目录里的Class类可以使用"Server.MapPath"的方法



一般新增aspx檔打"Server.MapPath"是可以作用的

但是如果新增放在App_Code裡的Class檔,打"Server.MapPath"是沒有作用的

要如何讓Class檔裡有"Server.MapPath"的方法呢..

step1:在Class檔裡要先using System.Web;

step2:利用HttpContext.Current.Server.MapPath就可以使用了


本文版权:http://www.ndfweb.cn/news-491.html
NDF网站建设淘宝店 | 联系我们
©2007-2025 NDF Corporation