如何获取参数在C#代码后面的URL中传递 [英] How to get Parameters passesd in the URL in C# code behind
本文介绍了如何获取参数在C#代码后面的URL中传递的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要将所有参数传递给URL。
例如:::
http://msdn.microsoft.com/en-us/library/dd329551(v=vs.100).aspx
在上面的网址中,我需要 en-us,library,dd329551(v = vs.100).aspx分开......
URL's可以动态构建..
所以有任何动态代码来提取参数..
I need to get all Parameters Passed to the URL .
For example:::
http://msdn.microsoft.com/en-us/library/dd329551(v=vs.100).aspx
In the above URL I need "en-us","library","dd329551(v=vs.100).aspx" separately...
URL's may dynamically built..
So is there any dynamic code to extract parameters..
推荐答案
请例如,请参阅此JavaScript实用程序: https://github.com/allmarkedup/purl [ ^ ]。
另外,通常是使用正则表达式和一些基本计算在代码中提取参数。例如,请参阅: http://www.jquery4u.com/snippets/url-parameters-jquery/ [ ^ ]。
-SA
Please see, for example, this JavaScript utility: https://github.com/allmarkedup/purl[^].
Alternatively, it's usual to extract parameters right in your code using Regex and some elementary calculations. See, for example: http://www.jquery4u.com/snippets/url-parameters-jquery/[^].
—SA
这篇关于如何获取参数在C#代码后面的URL中传递的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文