473,387 Members | 1,453 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

From C# to VC.net

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
Nov 16 '05 #1
2 1376
What problem are you facing? Show the MC++ version you created and also
state what errors you got when you tried to compile that.

--
Regards,
Nish [VC++ MVP]

"PawelR" <pa************@poczta.onet.pl> wrote in message
news:MP************************@news.tpi.pl...
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

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

--
Regards,
Nish [VC++ MVP]

"PawelR" <pa************@poczta.onet.pl> wrote in message
news:MP************************@news.tpi.pl...
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

Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: |-|erc | last post by:
Hi! Small challenge for you. The index.php uses this file and calls layout(). Take a look at www.chatty.net this file draws the chat login box on the right. I traced the CHAT button it submits...
16
by: Fuzzyman | last post by:
Hello, To create a classic (old style) class, I write : class foo: pass To do the equivalent as a new style class, I write : class foo(object):
2
by: nitin | last post by:
g++ -c $INCLUDES ActualPEResult.cpp In file included from /usr/include/c++/3.2.2/backward/iostream.h:31, from /home/pradeepks/Linux_Porting/dcpfrontier/dcpdev/dcp_components/trap...
4
by: susmita_ganguly | last post by:
Hi I am trying to upgrade from oracle 8i to oracle 9i on the same server ..I don't know much abt migration . Can anyone help me out. Thanks. Susmita
2
by: cs168 | last post by:
Hi I am new in ASP programming so I do use the very basic and simple way to do all my stuff. Now I do really got stuck at how can I loop thru the calculation for all my selection.. My full code is as...
7
by: dog | last post by:
I've seen plenty of articles on this topic but none of them have been able to solve my problem. I am working with an Access 97 database on an NT4.0 machine, which has many Access reports. I...
7
by: lgbjr | last post by:
Hello All, I¡¯m using a context menu associated with some pictureboxes to provide copy/paste functionality. Copying the image to the clipboard was easy. But pasting an image from the clipboard...
1
by: RSH | last post by:
Im trying to create a stored procedure of the following code. I want to set it so that I have to send the first 4 variables (@DB, @BackUpFile,@TestDB,@RestoreFile). I am having trouble when i try...
20
by: Development - multi.art.studio | last post by:
Hello everyone, i just upgraded my old postgres-database from version 7.1 to 7.4.2. i dumped out my 7.1 database (with pg_dump from 7.1) as an sql-file with copy-commands and to one file using...
6
by: ransoma22 | last post by:
I developing an application that receive SMS from a connected GSM handphone, e.g Siemens M55, Nokia 6230,etc through the data cable. The application(VB.NET) will receive the SMS automatically,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.