想要获取URL栏中的字符串,于是敲下代码如下:

string other = HttpContext.Current.Request.ServerVariables("QUERY_STRING");

结果报错:Request.QueryString 不能像使用方法那样使用不可调用

解决方法:将圆括号“()”改为方括号“[]"

string other = HttpContext.Current.Request.ServerVariables["QUERY_STRING"];

 

posted on 2014-12-15 09:44  Vennet  阅读(895)  评论(0编辑  收藏  举报