您现在的位置:首页 >> 软件开发 >> 内容

C#使用Request出现"不能像使用方法那样使用"

时间:2023-12-12 23:13:44 点击:

  核心提示:C#使用Request获取网址传递参数时显示如下错误:string other = HttpContext.Current.Request.ServerVariables('QUERY_STRING'...

C#使用Request获取网址传递参数时显示如下错误:


string other = HttpContext.Current.Request.ServerVariables("QUERY_STRING");
结果报错:Request.QueryString 不能像使用方法那样使用不可调用


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


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

作者:站长 来源:网络
相关文章
  • 没有相关文章
共有评论 0相关评论
发表我的评论
  • 大名:
  • 内容:
  • 陈工笔记(www.dui580.com) © 2024 版权所有 All Rights Reserved.
  • 站长:陈工 微信号:chengongbiji QQ:24498854
  • Powered by 陈工