Solved

QueryString Encrypt Decrypt

Posted on 2009-05-15
5
881 Views
Last Modified: 2013-12-17
I have a lots of forms in my project.
my url was like that

www.xxx.com/pages/frmLoanReq.aspx?moduleID=401

And I get id by QueryString on Page_Load on every form like  :

string strLogRef = Request.QueryString["moduleID"].ToString()

But now I send id by Encrypt :
www.xxx.com/pages/frmLoanReq.aspx?moduleID=ASLDK7234KAMV84;

I want to general code for not changing forms codes.

Something like this for general :

For example Request.QueryString["moduleID"].ToString() = DECRYPT( Request.QueryString["moduleID"].ToString() ).

Or what can I do?


0
Comment
Question by:TKorhan
  • 3
5 Comments
 
LVL 39

Expert Comment

by:abel
ID: 24394577
a small note on this first:

> string strLogRef = Request.QueryString["moduleID"].ToString()
it is already a string, ToString() is not necessary.... ;-)



So you want something like:

string strLogRef = Decrypt(Request.QueryString["moduleID"]);
but what do you mean with "general"? If you use C# 3.0 (in .NET 3.5) you can create an extension method for the Request, say, "DecryptedQueryString". When you call that, it would look something like the following:

string strLogRef = Request.DecryptedQueryString["moduleID"];
is that what you mean to do? Or is the first version enough?
0
 
LVL 4

Accepted Solution

by:
TKorhan earned 0 total points
ID: 24394686
I have found what I look for :
http://madskristensen.net/post/HttpModule-for-query-string-encryption.aspx

But you can help more...
0
 
LVL 39

Expert Comment

by:abel
ID: 24394714
Ah, I didn't know you meant that, to me it sounded that you already had an encryption module. So, what can I help you further with?
0
 
LVL 26

Expert Comment

by:Anurag Thakur
ID: 24395457
i have not seen you httpmodule code but was just browsing through and found one more implementation for the same - might be useful
http://www.eggheadcafe.com/articles/20060427.asp
0
 
LVL 39

Expert Comment

by:abel
ID: 24451507
Note that it is a custom (but not compulsory) that when you come with the answer yourself, esp. if it is slightly off the original question, to merit the experts that have spent time with you on the subject.

If you grade the comments, it won't cost you points (q. points will not be refunded when you find the solution yourself).
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Duplicate a row 2 33
Library to convert HTML to PDF. 8 46
Calling stored proc in EDMX 11 19
Format column on datatable 7 18
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now