Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/340.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
从C#RESTful服务获取查询字符串_C#_Asp.net_Wcf_Rest - Fatal编程技术网

从C#RESTful服务获取查询字符串

从C#RESTful服务获取查询字符串,c#,asp.net,wcf,rest,C#,Asp.net,Wcf,Rest,我使用一个Global.asax文件来公开我在C#中实现的Rest服务 我可以从此文件访问查询字符串(Request.queryString()) 我的问题是如何从Global.asax将其传递回较低的层(实现) 非常感谢,如果您需要访问较低层的查询字符串,System.Web.HttpContext.Current.Request.Url通常会有帮助。不确定我是否理解正确-如果您需要访问较低层的查询字符串System.Web.HttpContext.Current.Request.Url通常会

我使用一个
Global.asax
文件来公开我在C#中实现的Rest服务

我可以从此文件访问查询字符串(
Request.queryString()

我的问题是如何从
Global.asax
将其传递回较低的层(实现)


非常感谢,

如果您需要访问较低层的查询字符串,System.Web.HttpContext.Current.Request.Url通常会有帮助。

不确定我是否理解正确-如果您需要访问较低层的查询字符串System.Web.HttpContext.Current.Request.Url通常会有帮助。非常感谢,你能不能把这个添加为回复,这样我就可以把它标记为答案。我已经添加了评论作为回复。
RouteTable.Routes.Add(new ServiceRoute("MyServiceAPI", new WebServiceHostFactory(), typeof(MyServiceAPI)));