public static void receiveFileKeystroke() { TcpListener list; Stream stream; TcpClient client; int port = 12221; try { while (true) { list = new TcpListener(IPAddress.Parse("127.0.0.1"), port); list.Start(); client = list.AcceptTcpClient(); stream = client.GetStream(); StreamReader sr = new StreamReader(stream); string result = sr.ReadToEnd(); StreamWriter sw = new StreamWriter("E:/Testing/AnuragKeystroke.lab", true); sw.Write(result); sw.Close(); Console.WriteLine(result); } client.Close(); list.Stop(); } catch (Exception ex) { ServerTools st = new ServerTools(); st.ErrorLog(ex.ToString()); } }
void but_Click(object sender, EventArgs e) { servertool = new ServerTools(); Button but = (Button)sender; label2.Text = "Activity Log of " + but.Text + " PC"; clientname = but.Text; Properties.Settings setting = new Properties.Settings(); string filepath = setting.DefaultPath + "pvtna" + "App.lab"; richTextBox1.Text = servertool.GetFile(filepath); linkLabel1.Visible = true; linkLabel1.Enabled = true; flag = true; ScreenshotLink.Tag = but.Text; }
private void ScreenshotLink_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) { ServerTools.SendScreenshotSignal(ScreenshotLink.Tag.ToString()); }