首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

server.mappath保存的不是服务器地址?该怎么处理

2012-02-15 
server.mappath保存的不是服务器地址?我在本地的IIS测试,服务器地址是http://localhost:2220/AdWebSite1/

server.mappath保存的不是服务器地址?
我在本地的IIS测试,服务器地址是http://localhost:2220/AdWebSite1/文件都在这个下面,现在我在类库中写了个
string reglink=System.Web.HttpContext.Current.Server.MapPath("CheckOk.aspx")+"?username="+name+"&code="+code;

可是当我写入name和code读出来的reglink却是
E:\我写的asp.net\neT源代码\AdWebSite1\CheckOk.aspx?username=shijun&code=1111

而我想读出来的数据是http://localhost:2220/AdWebSite1/CheckOk.aspx?username=shijun&code=1111

请帮我解决下

[解决办法]
//http://localhost:2220
string host = "http://" Request.Url.Host;

热点排行