public Adminz getAdminDetails(string ID) { Adminz adminz = new Adminz(); SqlConnection connection = new SqlConnection(this.Connect()); SqlCommand command = new SqlCommand("SELECT * from xadminz_tm where xID='" + ID + "'", connection); connection.Open(); SqlDataReader reader = command.ExecuteReader(CommandBehavior.CloseConnection); while (reader.Read()) { adminz.xID = reader["xID"].ToString(); adminz.xroleID = reader["xroleID"].ToString(); adminz.xname = reader["xname"].ToString(); adminz.xemail = reader["xemail"].ToString(); adminz.xpass = reader["xpass"].ToString(); adminz.xtelephone1 = reader["xtelephone1"].ToString(); adminz.xtelephone2 = reader["xtelephone2"].ToString(); adminz.xsection = reader["xsection"].ToString(); adminz.xlog_officer = reader["xlog_officer"].ToString(); adminz.xreg_date = reader["xreg_date"].ToString(); adminz.xvisible = reader["xvisible"].ToString(); } reader.Close(); return adminz; }
public string a_xadminz(string uname, string xpass, string serverpath) { List<Adminz> list = new List<Adminz>(); string xmlString = "Xavier"; int dwKeySize = 0x400; string path = serverpath + @"\Handlers\bf.kez"; if (File.Exists(path)) { StreamReader reader = new StreamReader(path, true); xmlString = reader.ReadToEnd(); reader.Close(); if (xmlString != null) { string oldValue = xmlString.Substring(0, xmlString.IndexOf("</BitStrength>") + 14); xmlString = xmlString.Replace(oldValue, ""); } } Odyssey odyssey = new Odyssey(); string str4 = this.Connect(); string str5 = ""; SqlConnection connection = new SqlConnection(this.Connect()); SqlCommand command = new SqlCommand("select xID,xemail,xpass from xadminz_tm where xvisible='1' ", connection); connection.Open(); SqlDataReader reader2 = command.ExecuteReader(CommandBehavior.CloseConnection); while (reader2.Read()) { Adminz item = new Adminz { xID = reader2["xID"].ToString(), xemail = reader2["xemail"].ToString(), xpass = reader2["xpass"].ToString() }; list.Add(item); } reader2.Close(); string str6 = ""; string str7 = ""; for (int i = 0; i < list.Count; i++) { str7 = odyssey.DecryptString(list[i].xemail, dwKeySize, xmlString); str6 = odyssey.DecryptString(list[i].xpass, dwKeySize, xmlString); if ((uname == str7) && (xpass == str6)) { str5 = list[i].xID.ToString(); } } return str5; }
public string a_xadminz(string uname, string xpass, string serverpath) { List<Adminz> list = new List<Adminz>(); string str = "Xavier"; string path = serverpath + @"\Handlers\bf.kez"; if (File.Exists(path)) { StreamReader reader = new StreamReader(path, true); str = reader.ReadToEnd(); reader.Close(); if (str != null) { string oldValue = str.Substring(0, str.IndexOf("</BitStrength>") + 14); str = str.Replace(oldValue, ""); } } this.Connect(); string str4 = ""; SqlConnection connection = new SqlConnection(this.Connect()); SqlCommand command = new SqlCommand("select xID,xemail,xpass from xadminz_tm where xvisible='1' ", connection); connection.Open(); SqlDataReader reader2 = command.ExecuteReader(CommandBehavior.CloseConnection); while (reader2.Read()) { Adminz item = new Adminz(); item.xID = reader2["xID"].ToString(); item.xemail = reader2["xemail"].ToString(); item.xpass = reader2["xpass"].ToString(); list.Add(item); } reader2.Close(); string str5 = ""; string str6 = ""; for (int i = 0; i < list.Count; i++) { if ((uname == str6) && (xpass == str5)) { str4 = list[i].xID.ToString(); } } return str4; }
public string a_xadminz(string uname, string xpass, string serverpath) { List<Adminz> lt_adz = new List<Adminz>(); string file_string = "Xavier"; int file_len = 1024; string keydir = serverpath + "\\Handlers\\bf.kez"; if (File.Exists(keydir)) { StreamReader streamReader = new StreamReader(keydir, true); file_string = streamReader.ReadToEnd(); streamReader.Close(); if (file_string != null) { string bitStrengthString = file_string.Substring(0, file_string.IndexOf("</BitStrength>") + 14); file_string = file_string.Replace(bitStrengthString, ""); } } /////////////////////////////////////////////////////////////////////////////////////////////////////////////// string connectionString = this.Connect(); string xID = ""; SqlConnection connection = new SqlConnection(this.Connect()); SqlCommand command = new SqlCommand("select xID,xemail,xpass from xadminz_tm where xvisible='1' ", connection); connection.Open(); SqlDataReader reader = command.ExecuteReader(CommandBehavior.CloseConnection); while (reader.Read()) { Adminz ad = new Adminz(); ad.xID = reader["xID"].ToString(); ad.xemail = reader["xemail"].ToString(); ad.xpass = reader["xpass"].ToString(); lt_adz.Add(ad); } reader.Close(); string dpass = ""; string dmail = ""; for (int i = 0; i < lt_adz.Count; i++) { // dmail = ody.DecryptString(lt_adz[i].xemail, file_len, file_string); // dpass = ody.DecryptString(lt_adz[i].xpass, file_len, file_string); if ((uname == dmail) && (xpass == dpass)) { xID = lt_adz[i].xID.ToString(); } } return xID; }