public static Decrypt ( string cipherText ) : string | ||
cipherText | string | |
리턴 | string |
public void Read() { string sql = "SELECT * FROM Servers"; //using (SQLiteConnection conn = new SQLiteConnection()) //{ //} string result = base.ExecuteQuery(sql, null); this.ArrayListServers.Clear(); if (result == string.Empty) { if (base.Database.Reader.HasRows) { while (base.Database.Reader.Read()) { Model_ServerDetails sd = new Model_ServerDetails() { UID = base.Database.Reader["uid"].ToString(), GroupID = int.Parse(base.Database.Reader["groupid"].ToString()), ServerName = base.Database.Reader["servername"].ToString(), Server = base.Database.Reader["server"].ToString(), Domain = base.Database.Reader["domain"].ToString(), Port = int.Parse(base.Database.Reader["port"].ToString()), Username = base.Database.Reader["username"].ToString(), Password = (new Func <string>(() => { string pword = base.Database.Reader["password"].ToString(); if (pword != string.Empty) { pword = RijndaelSettings.Decrypt(pword); } return(pword); }).Invoke()), Description = base.Database.Reader["description"].ToString(), ColorDepth = int.Parse(base.Database.Reader["colordepth"].ToString()), DesktopWidth = int.Parse(base.Database.Reader["desktopwidth"].ToString()), DesktopHeight = int.Parse(base.Database.Reader["desktopheight"].ToString()), Fullscreen = int.Parse(base.Database.Reader["fullscreen"].ToString()) == 1 ? true : false }; this.ArrayListServers.Add(sd); } } } else { base.Database.CloseConnection(); System.Diagnostics.Debug.WriteLine(result); throw new Exception(result); } base.Database.CloseConnection(); }
public void Read() { string sql = "SELECT * FROM Servers"; //using (SQLiteConnection conn = new SQLiteConnection()) //{ //} SQLiteDataReader reader; string result = ExecuteQuery(sql, null, out reader); this._alServes.Clear(); if (result == string.Empty) { while (reader.Read()) { ServerDetails sd = new ServerDetails(); sd.UID = reader["uid"].ToString(); sd.GroupID = int.Parse(reader["groupid"].ToString()); sd.ServerName = reader["servername"].ToString(); sd.Server = reader["server"].ToString(); sd.Domain = reader["domain"].ToString(); sd.Port = int.Parse(reader["port"].ToString()); sd.Username = reader["username"].ToString(); string pword = reader["password"].ToString(); if (pword != string.Empty) { pword = RijndaelSettings.Decrypt(pword); } sd.Password = pword; sd.Description = reader["description"].ToString(); sd.ColorDepth = int.Parse(reader["colordepth"].ToString()); sd.DesktopWidth = int.Parse(reader["desktopwidth"].ToString()); sd.DesktopHeight = int.Parse(reader["desktopheight"].ToString()); sd.Fullscreen = int.Parse(reader["fullscreen"].ToString()) == 1 ? true : false; this._alServes.Add(sd); } reader.Close(); } else { CloseConnection(); System.Diagnostics.Debug.WriteLine(result); throw new Exception(result); } CloseConnection(); }