public JObject Paste() { // Paste JObject response = PasteTube.MakeRequest("/Paste?userid=" + userid); return(response); }
private static void MyThread(string userid) { Console.WriteLine(userid); PasteTube client = new PasteTube(userid); string old = string.Empty; while (true) { JObject response = client.Paste(); string new_online = response["data"].ToString(); var new_offline = Clipboard.GetText(); if (new_offline != old) { old = new_offline; Console.WriteLine(old); client.Copy(old); } else if (new_online != old) { old = new_online; Console.WriteLine(old); Clipboard.SetText(old); } Thread.Sleep(100); } }
public JObject Copy(string data) { // Copy JObject response = PasteTube.MakeRequest("/Copy?userid=" + userid + "&data=" + data); return(response); }
public JObject GetConnectedDevices() { // GetConnectedDevices JObject response = PasteTube.MakeRequest("/GetConnectedDevices?userid=" + userid); return(response); }
public static string CreateUser() { // Create User first JObject response = PasteTube.MakeRequest("/CreateUser"); string userid_temp = response["userid"].ToString(); return(userid_temp); }
public PasteTube(string p_userid) { userid = p_userid; // Connect JObject response = PasteTube.MakeRequest("/Connect?mac=xyz&userid=" + userid); // MessageBox.Show(userid, "test", MessageBoxButtons.YesNo); }
private void metroButton1_Click(object sender, EventArgs e) { this.metroButton1.Hide(); this.metroButton2.Hide(); string userid = PasteTube.CreateUser(); // Create QR Code QRCodeGenerator qrGenerator = new QRCodeGenerator(); QRCodeData qrCodeData = qrGenerator.CreateQrCode(userid, QRCodeGenerator.ECCLevel.Q); QRCode qrCode = new QRCode(qrCodeData); Bitmap qrCodeImage = qrCode.GetGraphic(20); this.pictureBox1.Image = qrCodeImage; this.pictureBox1.SizeMode = PictureBoxSizeMode.Zoom; this.pictureBox1.Show(); //var t = new Thread(() => MyThread(userid)); //t.Start(); MyThread(userid); this.Text = "PasteTube : Running!"; }