CGC_Codes

Hash Password

Feb 8th, 2017
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.71 KB | None | 0 0
  1. using System;
  2. using System.Data;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Xml.Linq;
  6. using System.Net.Mail;
  7. using System.Text;
  8. using System.Collections.Generic;
  9. using System.IO;
  10. using System.Web.Security;
  11.  
  12. namespace SilverLight
  13. {
  14.     public class Utility
  15.     {
  16.         #region HashPassword
  17.         public static string HashPassword(int UserID, string Password)
  18.         {
  19.             string HashedPassword = "";
  20.            
  21.             string UserPasswordAttempt = String.Format("{0}{1}", UserID.ToString(), Password);
  22.            
  23.             HashedPassword = FormsAuthentication.HashPasswordForStoringInConfidFile(UserPasswordAttempt,
  24.             System.Web.Configuration.FormsAuthenticationFormat.MD5.ToString());
  25.            
  26.             return HashPassword;
  27.         }
  28.         #endregion
  29.     }
Advertisement
Add Comment
Please, Sign In to add comment