Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Hi,

When I am using the following code
byte[] data = System.Text.Encoding.ASCII.GetBytes(contraseña.Text);
byte[] result;
SHA1CryptoServiceProvider hash = new SHA1CryptoServiceProvider();
result = hash.ComputeHash(data);



thanks
vara prasad

[edit]Code block added - OriginalGriff[/edit]
Posted
Updated 20-Apr-11 9:12am
v5
Comments
Dalek Dave 20-Apr-11 4:03am    
Edited for Readability.
Sergey Alexandrovich Kryukov 20-Apr-11 15:13pm    
Edited tags: ASP.NET is irrelevant to the "problem"
--SA

Put your text cursor at the end of the word "SHA1CryptoServiceProvider" and a small hollow red block will appear underneath the right hand side of the word. Move the mouse over the block, and a drop down will appear with two options:
"using System.Security.Cryptography"

and
"System.Security.Cryptography.SHA1CryptoServiceProvider"

If you click the first one, it will insert the correct using statement, if you select the second, it will add the full namespace specification to the SHA1CryptoServiceProvider instance.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 20-Apr-11 15:15pm    
As if helping to use Google was not enough, shall we also need to help searching the standard .NET library? It could lead too far (should I say "nowhere"?)... :-)
My 5 though.
--SA
OriginalGriff 21-Apr-11 3:42am    
Yes, but in this case it allows me to tell him how to do it the easy way: via intellisense.
Sergey Alexandrovich Kryukov 21-Apr-11 3:55am    
I would probably just shout "Google it!". This is a matter of seconds...
--SA
Namespace: System.Security.Cryptography
Assembly: mscorlib (in mscorlib.dll)

Hope this will work for you.
 
Share this answer
 
Comments
Dalek Dave 20-Apr-11 4:03am    
Good Call.
Prasanta_Prince 20-Apr-11 12:17pm    
Thank You Dalek Dave
Sergey Alexandrovich Kryukov 20-Apr-11 15:16pm    
That's correct, a 5, but... sigh... please see my comment to Griff's answer?
--SA

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