Exemplo n.º 1
0
        public static void MultySystemDebugs(IMyLog log, QuestionOption it)
        {
            var x1 = DSSwitch.appUser().GetType();
            var x2 = DSSwitch.full().GetNiceSystemType();

            DSSwitch.appUser().RetrieveAll(Data_AppUserFile.SortType.State, null, log);
        }
Exemplo n.º 2
0
        public static void AddToFree(IMyLog log, QuestionOption it)
        {
            try
            {
                string email   = Question.Ask("Email");
                string telList = Question.Ask("TelList");

                string         url     = WhatsappMessages.GetHost("APIPrivAddTel");
                HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
                request.Method      = "POST";
                request.ContentType = "application/x-www-form-urlencoded";
                request.Headers.Add("X-EmailB64", Convert.ToBase64String(Encoding.ASCII.GetBytes(email)));
                request.Headers.Add("X-TelList", telList);
                LowLevelHttpDumper.Dump(request);
                using (StreamWriter streamOut = new StreamWriter(request.GetRequestStream()))
                {
                    streamOut.Write(" ");
                }
                using (StreamReader streamIn = new StreamReader(request.GetResponse().GetResponseStream()))
                {
                    Console.WriteLine(streamIn.ReadToEnd());
                }
            }
            catch (SystemException se)
            {
                Console.WriteLine(se.Message);
            }
            Console.ReadLine();
        }
Exemplo n.º 3
0
        private void lAny(IMyLog log, QuestionOption it)
        {
            Console.Clear();
            string select = "SELECT [Date], [Level], [Logger], [Message] FROM [dbo].[Log] ";

            string where = String.Format("WHERE [Logger] like '{0}'", it.OptionText);
            if (!String.IsNullOrEmpty(limitQueryForDate))
            {
                where += limitQueryForDate;
            }

            string order = "ORDER BY [Date] ";

            string cmd = select + where + order;

//            String.Format(@"
//SELECT [Date], [Level], [Logger], [Message] FROM [dbo].[Log]
//WHERE [Logger] like '{0}'
//ORDER BY [Date]
//", it.OptionText);

            using (SqlDisposable s = new SqlDisposable(SQLDBConfig.DBToUse.LogDB, cmd))
            {
                while (s.Reader.Read())
                {
                    DateTime Date = (DateTime)s.Reader["Date"];
                    Date = Date.AddHours(4);//mg to get date in brasil
                    String Level   = (String)s.Reader["Level"];
                    String Logger  = (String)s.Reader["Logger"];
                    String Message = (String)s.Reader["Message"];
                    Console.WriteLine(String.Format("{0:dd/MM HH:mm} {1} {2} {3}",
                                                    Date, Level, Logger, Message));
                }
            }
        }
Exemplo n.º 4
0
        public static void Go(IMyLog log, QuestionOption it)
        {
            List <One> d         = Fill();
            string     startWith = "";
            int        depth     = 1;

            while (true)
            {
                Question   q       = new Question();
                List <One> subList = d.Where(x => x.depth == depth && x.Id.StartsWith(startWith)).ToList();
                foreach (var c in subList)
                {
                    q.Add(new QuestionOption(c.Title, null));
                }
                QuestionOption u = q.AskAndReturnOption("Select");

                One selected = d.FirstOrDefault(x => x.Title == u.OptionText);
                if (selected.Text != null)
                {
                    // end
                    Console.Clear();
                    System.Windows.Forms.Clipboard.SetText(selected.Text);
                    Console.WriteLine(selected.Text);
                    Console.WriteLine();
                    Console.WriteLine("now in Clipboard");
                    Console.ReadKey();
                    return;
                }
                depth++;
                startWith = selected.Id + "_";
            }
        }
Exemplo n.º 5
0
        public static void GetNewAPIId(IMyLog log, QuestionOption it)
        {
            string email = Question.Ask("Enter email");
            string apiid = Data_AppUserFile.API_ToId(email, Guid.NewGuid());

            Console.WriteLine("New APIId produced for " + email);
            Console.WriteLine(apiid);
        }
Exemplo n.º 6
0
 public static void DebugLoopback(IMyLog log, QuestionOption it)
 {
     using (DataFile_Loopback ld = new DataFile_Loopback(DataFile_Base.OpenType.ForUpdate_CreateIfNotThere))
     {
         ld.LastError = "e13";
         ld.GetEntry_CreateIfNotThere(NiceSystemInfo.DEFAULT_STR).debugStr = "Zero is nice at " + DateTime.UtcNow.Ticks.ToUkTime(false);
         ld.GetEntry_CreateIfNotThere("123").debugStr = "only testing";
     }
 }
Exemplo n.º 7
0
 public static void DebugAndroidSyncInLowLib(IMyLog log, QuestionOption it)
 {
     //AndroidSynchroniserThread.OnLog = ToDebug;
     //AndroidSynchroniserThread.DoWeRellyWantToRun = true;
     //var x = AndroidSynchroniserThread.I;
     //while (true)
     //{
     //    Thread.Sleep(500);
     //}
 }
Exemplo n.º 8
0
        public static void EmailFromAPpiKey(IMyLog log, QuestionOption it)
        {
            var    key   = Question.Ask("Enter API Key");
            string email = Data_AppUserFile.API_IdToEmail(key);

            email = Data_AppUserFile.EmailToRealEmail(email);
            Console.WriteLine(key);
            Console.WriteLine(email);
            Console.WriteLine("");
        }
Exemplo n.º 9
0
        public static string GetHost(string ending)
        {
            Question q = new Question();

//            q.Add(new QuestionOption("https://whatsappapi.net/" + ending, null));
            q.Add(new QuestionOption("https://niceapi.net/" + ending, null));
            q.Add(new QuestionOption("http://localhost:60257/" + ending, null));
            q.Add(new QuestionOption("http://127.0.0.1/LocalNiceApi/" + ending, null));
            q.Add(new QuestionOption("http://localhost/Nice_WithSql/" + ending, null));
            QuestionOption o = q.AskAndReturnOption("Select host");

            return(o.OptionText);
        }
Exemplo n.º 10
0
 public static void Analyse(IMyLog log, QuestionOption it)
 {
     try
     {
         Console.WriteLine("Getting # from server...");
         var data = ContactHost();
         var dir  = ParseTextList(data);
         dumpDuplicates(dir);
     }
     catch (SystemException e)
     {
         Console.WriteLine("SystemException");
         Console.WriteLine(e.Message);
         Console.ReadLine();
     }
 }
Exemplo n.º 11
0
 private void lLimit(IMyLog log, QuestionOption it)
 {
     Console.Clear();
     Console.WriteLine("Current val: " + limitQueryForDate);
     if (Question.Ask("Edit?", "Yes"))
     {
         try
         {
             Int32 newDays = Int32.Parse(Question.Ask("Enter days"));
             setLimitQueryForDate(newDays);
         }
         catch
         {
         }
     }
 }
Exemplo n.º 12
0
        public static void Error500(IMyLog log, QuestionOption it)
        {
            string fileData = File.ReadAllText(@"C:\NiceApi\NiceLog_500Error1.txt");

            string[] fileDataSplit = fileData.Split(new string[] { "\r\n" }, 3, StringSplitOptions.None);

            string message   = fileDataSplit[2];
            string apiMobile = fileDataSplit[1];
            string apiId     = fileDataSplit[0];

            int msgLength = message.Length;

            //message = "".PadLeft(msgLength, 'A');


            SendNormalPost(message, apiMobile, apiId);
        }
Exemplo n.º 13
0
        public static void LibAPI(IMyLog log, QuestionOption it)
        {
            string GUID = null;
            bool   go   = true;

            Console.Clear();
            Question ques = new Question();

            ques.Add(new QuestionOption("Exit", delegate(IMyLog dlog, QuestionOption dit)
            {
                go = false;
            }));
            //////////////////////////////////////////////////////////////////
            while (go)
            {
                ques.AskAndAct("What to do", log);
            }
        }
Exemplo n.º 14
0
        public static void Go(IMyLog log, QuestionOption it)
        {
            List <ftpFile> list = getList();
            cUrlCmd        cfg  = getcUrlCmd();
            StringBuilder  sb   = new StringBuilder();

            sb.Append(cfg.pre);
            foreach (ftpFile e in list)
            {
                if (e.sub != null)
                {
                    string line = $"-T \"{cfg.srcPath}{e.sub}\\{e.src}\" \"{cfg.dstPath}{e.sub}/\" ";
                    sb.Append(line);
                }
                else
                {
                    string line = $"-T \"{cfg.srcPath}{e.src}\" \"{cfg.dstPath}\" ";
                    sb.Append(line);
                }
            }
            sb.Append(cfg.pos);
            System.IO.File.WriteAllText(cfg.batName, sb.ToString());
        }
Exemplo n.º 15
0
        public static void DebugDisplayTextControllerPart_MultiLine(IMyLog log, QuestionOption it)
        {
            string                res;
            StringBuilder         sb = new StringBuilder();
            StringBuilder         im = new StringBuilder();
            DisplayTextController c  = new DisplayTextController(false);

            c.AddLineAndUpdate3(new DetailedData_LastBadProcess(13, new TimeSpan(13)), out res, sb); resOut(res);
            c.AddLineAndUpdate3(new DetailedData_LastBadProcess(13, new TimeSpan(13)), out res, sb); resOut(res);

            c.AddLineAndUpdate3(new DetailedData_AndroidCommunication_BT(DetailedData_AndroidCommunication_BT.eType.eFirstInit), out res, sb); resOut(res);

            c.AddLineAndUpdate3(new DetailedData_AndroidCommunication_BT(DetailedData_AndroidCommunication_BT.eType.eStart), out res, sb); resOut(res);
            c.AddLineAndUpdate3(new DetailedData_AndroidCommunication_BT(DetailedData_AndroidCommunication_BT.eType.eReportEndPoint, "TheEndPoint"), out res, sb); resOut(res);
            c.AddLineAndUpdate3(new DetailedData_AndroidCommunication_BT(DetailedData_AndroidCommunication_BT.eType.eReportTelNumbers, 0, 31), out res, sb); resOut(res);
            c.AddLineAndUpdate3(new DetailedData_AndroidCommunication_BT(DetailedData_AndroidCommunication_BT.eType.eReportTelNumbers, 13, 0), out res, sb); resOut(res);
            c.AddLineAndUpdate3(new DetailedData_AndroidCommunication_BT(DetailedData_AndroidCommunication_BT.eType.eDone, true, DateTime.Now.AddSeconds(30)), out res, sb); resOut(res);

            c.AddLineAndUpdate3(new DetailedData_AndroidCommunication_BT(DetailedData_AndroidCommunication_BT.eType.eStart), out res, sb); resOut(res);
            c.AddLineAndUpdate3(new DetailedData_AndroidCommunication_BT(DetailedData_AndroidCommunication_BT.eType.eReportEndPoint, "TheEndPoint"), out res, sb); resOut(res);
            c.AddLineAndUpdate3(new DetailedData_AndroidCommunication_BT(DetailedData_AndroidCommunication_BT.eType.eReportTelNumbers, 113, 131), out res, sb); resOut(res);
            c.AddLineAndUpdate3(new DetailedData_AndroidCommunication_BT(DetailedData_AndroidCommunication_BT.eType.eDone, false, DateTime.Now.AddSeconds(30)), out res, sb); resOut(res);

            c.AddLineAndUpdate3(new DetailedData_AndroidCommunication_BT(DetailedData_AndroidCommunication_BT.eType.eStart), out res, sb); resOut(res);
            c.AddLineAndUpdate3(new DetailedData_AndroidCommunication_BT(DetailedData_AndroidCommunication_BT.eType.eReportEndPoint, "TheEndPoint"), out res, sb); resOut(res);
            c.AddLineAndUpdate3(new DetailedData_AndroidCommunication_BT(DetailedData_AndroidCommunication_BT.eType.eReportTelNumbers, 13, 31), out res, sb); resOut(res);
            c.AddLineAndUpdate3(new DetailedData_AndroidCommunication_BT(DetailedData_AndroidCommunication_BT.eType.eDone, true, DateTime.Now.AddSeconds(30)), out res, sb); resOut(res);

            c.AddLineAndUpdate3(new DetailedData_AndroidCommunication_BT(DetailedData_AndroidCommunication_BT.eType.eStart), out res, sb); resOut(res);
            c.AddLineAndUpdate3(new DetailedData_AndroidCommunication_BT(DetailedData_AndroidCommunication_BT.eType.eReportEndPoint, "TheEndPoint"), out res, sb); resOut(res);
            c.AddLineAndUpdate3(new DetailedData_AndroidCommunication_BT(DetailedData_AndroidCommunication_BT.eType.eReportTelNumbers, 13, 31), out res, sb); resOut(res);
            c.AddLineAndUpdate3(new DetailedData_AndroidCommunication_BT(DetailedData_AndroidCommunication_BT.eType.eDone, true, DateTime.Now.AddSeconds(30)), out res, sb); resOut(res);

            c.GetStatus().TheList.ForEach(e => e.ToIntermapperInfo(im));
            Debug.WriteLine("-----------------------------");
            Debug.WriteLine(im.ToString());
        }
Exemplo n.º 16
0
 public static void SendTelSync(IMyLog log, QuestionOption it)
 {
     if (Question.Ask("This is dangerous, Do you really want to do that? (Y)", "Y"))
     {
         try
         {
             string url = WhatsappMessages.GetHost("ItemX");// "https://whatsappapi.net/API";
             url += "?id=GetAllTelNumbers";
             if (Question.Ask("Add at least a noSync=1 (y)", "y"))
             {
                 url += "&noSync=1";
             }
             Console.WriteLine("Your url is:");
             Console.WriteLine(url);
             if (Question.Ask("Use it? (Y)", "Y"))
             {
                 HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
                 //                    request.Method = "POST";
                 //                    request.ContentType = "application/x-www-form-urlencoded";
                 //                    request.Headers.Add("id", "GetAllTelNumbers");
                 //using (StreamWriter streamOut = new StreamWriter(request.GetRequestStream()))
                 //{
                 //    streamOut.Write("");
                 //}
                 using (StreamReader streamIn = new StreamReader(request.GetResponse().GetResponseStream()))
                 {
                     Console.WriteLine(streamIn.ReadToEnd());
                 }
             }
         }
         catch (SystemException se)
         {
             Console.WriteLine(se.Message);
         }
         Question.Ask("Done");
     }
 }
Exemplo n.º 17
0
        public static void Go(IMyLog log, QuestionOption it)
        {
            DSSwitch.appWallet().RetrieveAll(
                delegate(Data_AppUserWallet w1)
            {
                Console.WriteLine();
                Console.WriteLine(w1.RequestedType.ToString());
                Console.WriteLine(w1.Title);
                Console.WriteLine(w1.Email);
                foreach (var l1 in w1.DisplayLines)
                {
                    Console.WriteLine(l1);
                }
                Console.WriteLine(w1.Setup.ToString("Setup"));
                Console.WriteLine(w1.Messages.ToString("Messages"));
                Console.WriteLine(w1.Month.ToString("Month"));
                Console.WriteLine(w1.Numbers.ToString("Numbers"));

                Console.WriteLine();
                PriceAndText pt = w1.CalucateCost();
                Console.WriteLine(pt.Explained);
                Console.WriteLine(pt.FinalPrice);
            }, log);
        }
Exemplo n.º 18
0
 public static void ShowAll(IMyLog log, QuestionOption it)
 {
     throw new NotImplementedException("not suitable for publication!");
 }
Exemplo n.º 19
0
 public static void Go(IMyLog log, QuestionOption it)
 {
     new FtpBackup().go();
 }
Exemplo n.º 20
0
 public static void CheckCredit(IMyLog log, QuestionOption it)
 {
     SendNormal(User.selectUser(), true);
 }
Exemplo n.º 21
0
 public static void GoSysTest(IMyLog log, QuestionOption it)
 {
     SendNormal(User.userSysTest());
 }
Exemplo n.º 22
0
 public static void Go(IMyLog log, QuestionOption it)
 {
     SendNormal(User.selectUser());
 }
Exemplo n.º 23
0
 public static void Debug_DirectTel(IMyLog log, QuestionOption it)
 {
     throw new NotImplementedException("not suitable for publication!");
 }
Exemplo n.º 24
0
 public void Add(QuestionOption o)
 {
     Options.Add(o);
 }
Exemplo n.º 25
0
        public static void LibVersion(IMyLog log, QuestionOption it)
        {
            Assembly a = Assembly.GetAssembly(typeof(IMyLog));

            Console.Write(a.FullName.ToString() + "\r\n");
        }
Exemplo n.º 26
0
 public static void JustALogMessage(IMyLog log, QuestionOption it)
 {
     log.Info("JustALogMessage");
 }
Exemplo n.º 27
0
 public static void Go(IMyLog log, QuestionOption it)
 {
     new ShowLogs(log).Loop();
 }