From C# to VC.net

P

PawelR

Hello Group

I've problem with convert this function

private string getMD5(string s1)
{
string s1 = "UserName"
byte[] data1ToHash = (new UnicodeEncoding()).GetBytes(s1);
byte[] hashvalue1 = ((HashAlgorithm) CryptoConfig.CreateFromName
("MD5")).ComputeHash(data1ToHash);
string s2=BitConverter.ToString(hashvalue1);
for (int i=s2.Length;i>3;i-=3) s2=s2.Remove(i-3,1);
s2=s2.Replace("A","1");
s2=s2.Replace("0","A");
s2=s2.Replace("1","0");
return s2;
}

This generate hash string - code to application.
My question: How write this function in C++.Net (mfc)?

Thx
PawelR
 
N

Nishant S

What problem are you facing? Show the MC++ version you created and also
state what errors you got when you tried to compile that.
 
N

Nishant S

What problem are you facing? Show the MC++ version you created and also
state what errors you got when you tried to compile that.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top