如何通过在asp.net加密查询字符串 [英] how to pass encrypted query string in asp.net

查看:76
本文介绍了如何通过在asp.net加密查询字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要asp.net页面之间传递值。如何加密URL中的这些价值观?
例如:Response.Redirect的(?customerAdd.aspx客户ID =+ CUSTID);

I need to pass values between asp.net pages. How do i encrypt those values in the URL? Example : Response.Redirect("customerAdd.aspx?customerId=" + custId);

推荐答案

查看的Mads克里斯滕森对一个HttpModule,将加密文章/解密所有你的查询字符串。
<一href=\"http://madskristensen.net/post/httpmodule-for-query-string-encryption\">http://madskristensen.net/post/httpmodule-for-query-string-encryption

Check out Mads Kristensen's article for an HttpModule that will encrypt/decrypt all of your querystrings. http://madskristensen.net/post/httpmodule-for-query-string-encryption

他的code使用一个HttpModule来解析HTML传出加密和替换所有相对路径查询字符串。该HTTP模块还捕获传入的请求并重写请求URL使用未加密的查询字符串。

His code uses an HttpModule to parses outgoing HTML to encrypt and replace all relative path querystrings. The HttpModule also captures incoming requests and rewrites the request url to use an unencrypted querystring.

的好处是,你可以在模块中下降,你的code不需要时,查询字符串被加密或不知道。从code的角度来看,查询字符串的工作就像他们总是这样。

The nice part is that you can drop in the module and your code doesn't need to know when the querystrings are encrypted or not. From the code perspective, querystrings work like they always do.

我们已经现在使用它了五年多,它的伟大工程。

We've been using it for over five years now and it works great.

这篇关于如何通过在asp.net加密查询字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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