コード例 #1
0
 private string CheckPassword(HttpContext context)
 {
     try
     {
         string        loginName = context.Request["LOGINNAM"] as string;
         string        password  = context.Request["Password"] as string;
         MD5           md        = new MD5CryptoServiceProvider();
         byte[]        bytes     = Encoding.Unicode.GetBytes(password);
         string        md5Pass   = BitConverter.ToString(md.ComputeHash(bytes)).Replace("-", "");
         LSFW_EMPLOYEE model     = dal.GetUserLogin(loginName, md5Pass);
         if (!string.IsNullOrEmpty(model.LOGINNAME))
         {
             return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("0", xml.ReadLandXml("0"))));
         }
         else
         {
             return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("1", xml.ReadLandXml("1"))));
         }
     }
     catch (Exception ex)
     {
         SystemErrorPlug.ErrorRecord(ex.ToString());
         return(JsonHelper <Messaging <string> > .EntityToJson(new Messaging <string>("500", ex.Message)));
     }
 }