Request.QueryString怎样获取带参数的网址

来源:百度知道 编辑:UC知道 时间:2024/09/22 15:40:46
Request.QueryString怎样获取带参数的网址?
如:http://www.baidu.com?url=http://www.fpdislay.com?a=e&p=1&t=3
url参数是:http://www.fpdislay.com?a=e&p=1&t=3
我怎样获取完整网址的url地址?(正确的地址http://www.fpdislay.com?a=e&p=1&t=3)

有Request.QueryString["url"]只能获取到http://www.fpdislay.com?a=e,请达人帮帮忙.

使用子字符串获取不要使用Request.QueryString。

string Indicator="url=";
string url = Request.Url.ToString();
int index = url.IndexOf(Indicator);
string urlpar = url.Substring(index + Indicator.Length, url.Length - index - Indicator.Length));

urlpar就是你需要的结果,而Indicator就是标志参数的关键字

用Post试试

querystring只取参数,该用Request.ServerVariables("SCRIPT_NAME")来取完整地址