Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C++ C Javascript MFC Post VC VC++ , +
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 1-Dec-12 8:10am
Joneeky620
Edited 1-Dec-12 20:53pm
v2
Comments
Nelek at 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?[^]
Joneeky at 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.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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
  Permalink  
Comments
Joneeky at 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 at 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 at 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 at 3-Dec-12 5:18am
   
http://msdn.microsoft.com/en-us/library/w3te6wfz.aspx
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Take a look at these samples[^].
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 304
1 Maciej Los 285
2 Sergey Alexandrovich Kryukov 255
3 Shweta N Mishra 216
4 PIEBALDconsult 174
0 OriginalGriff 7,660
1 Sergey Alexandrovich Kryukov 7,072
2 DamithSL 5,604
3 Manas Bhardwaj 4,986
4 Maciej Los 4,760


Advertise | Privacy | Mobile
Web01 | 2.8.1411023.1 | Last Updated 2 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100