将url分配给字符串并从中获取参数 [英] assign url to string and get parameters out of it

查看:80
本文介绍了将url分配给字符串并从中获取参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个分配给字符串的URL(字符串url ="asp.net/use=hi?password=hello").现在我想从该字符串(使用和密码)中获取参数.谁能告诉我该怎么做.我为此使用了querystring,但它只是从当前页面的url而不是string的参数中获取参数.请帮帮我.
在此先感谢

i have a url assigned to a string(string url="asp.net/use=hi?password=hello").now i want to get parameters out of this string(use and password). can anyone please tell me how to do it. i have use querystring for that but it just takes parameters from url of the current page not of the string.please help me out.
thanks in advance

推荐答案

以这种方式实施身份验证不是一个好主意,请查看:页面的参数的访问 [ ^ ],则应使用 Params [ Page.Request [ ASP.NET安全性 [ ^ ].

这是一个分步演练,对您可能会有所帮助:如何在ASP.NET应用程序中实现基于表单的身份验证 [^ ]

最好的问候
Espen Harlinn
Implementing authentication this way is not a good idea, please have a look at: Security: It’s Getting Worse[^]

As for access to the parameters for a Page[^], you should use the Params[^] property of the Page.Request[^] property.

ASP.Net provides what you need to implement authentication and authorization, please read: ASP.NET Security[^].

Here is a step-by-step walk-through that you might find helpful:How To Implement Forms-Based Authentication in Your ASP.NET Application[^]

Best regards
Espen Harlinn


[^ ]将为您提供一个良好的开始.
This[^] will give you a good start to proceed with.


您好 使用REWRITE URL通过使用response.redirect()隐藏值 尝试
HI TO USE THE REWRITE URL to hide values by using response.redirect()
TRY THIS


这篇关于将url分配给字符串并从中获取参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆