Click here to Skip to main content
15,880,503 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
There are some groups of data:

before encode: djVjM3R5emFu
after encode: RDJNNEU4MjAyMjI3MjkzMjM0

djFibGhzejk=
RjIxMTE0MTYxOTI0MjkzMw%3D%3D

ODVxd2tsM2ptemlu
QzNPNFk5MTAxMjE2MjAyNTI4MjkzMTM0

N3ExbGd4dG0yaQ==
UjZaOTExMTYxNzIxMjIyODMwMzE%3D

NjV1MWxndDk=
RjFINFY3MTExNjE3MjIzMw%3D%3D

----
Please help me. It's very important to me. Thanks!!
Posted
Updated 1-Dec-12 19:53pm
v2
Comments
Nelek 1-Dec-12 13:45pm    
?????
Please don't think we can read minds or do astral projections to see your monitor. If you need help, the least you could do is to add some relevant code to your question or to explain your problem in such a way, that the users of CP can understand it. Otherwise, nobody will be able to help you.
How to ask a question?[^]
[no name] 2-Dec-12 2:15am    
Dear Joneeky,
actually i don't understand your problem. provide a detailed explanation.
Joneeky 2-Dec-12 2:28am    
Sorry! For an eg.. A function called "Encode", It declared like "void Endcode(CString& str)".Then I call it by...
CStirng str = _T("djVjM3R5emFu");
Encode(str);
...
The result of str is "RDJNNEU4MjAyMjI3MjkzMjM0".
I just want know how I can write the "Encode" function.
I think coders can understand my meaning.

When you use the encode and decode commands/functions/methods

you are only expected to encode/decode the values.
So if you have something like....
RedirectUrl = ("PlaceOrder.aspx?ProductName=Toolbox complete with free Spanners")

You can break that down into the following portions.......

PAGE KEY VALUE... Where...
PAGE is "PlaceOrder.aspx"
KEY is "ProductName" (no spaces!)
VALUE is "Toolbox complete with free Spanners"

Then you would ONLY encode/decode the VALUE(s)
So you would end up with something like....
RedirectUrl = ("PlaceOrder.aspx?ProductName=" & httpEncode("Toolbox complete with free Spanners"))


And as we used ENCODE to encode the VALUE, on the other side (where the data is recieved) we would use DECODE to decode the VALUE only.

Keep in mind that you can have MULTIPLE key/value pairs but ONLY one page
 
Share this answer
 
Comments
Joneeky 2-Dec-12 1:52am    
Thank you for your answer.I'm understand your meaning.But I just want to know how to encode for it. Such as "djVjM3R5emFu" to "RDJNNEU4MjAyMjI3MjkzMjM0", must have a process to do it. Now, I want to find out the process.
Zaf Khan 2-Dec-12 9:51am    
Take a look at the MSDN documentation for the HTTPUtility.HtmlEncode Method which van be found on http://msdn.microsoft.com/en-us/library/w3te6wfz.aspx or by clicking here
Joneeky 2-Dec-12 9:58am    
I can not open this link, it displays "Unable to Service Request". Can you copy it and paste on here?
Zaf Khan 3-Dec-12 5:18am    
http://msdn.microsoft.com/en-us/library/w3te6wfz.aspx
Take a look at these samples[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900