日期:2014-05-18  浏览次数:20520 次

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;