fork download
  1. using System.IO;
  2. using System.Net;
  3. using System;
  4. using System.Threading;
  5. using N = System.Net;
  6. using System.Collections;
  7. using System.Windows.Forms;
  8. using System.ComponentModel;
  9. using System.Runtime.InteropServices;
  10.  
  11. class TalkUser {
  12.  
  13. static Form talk;
  14. static N.Sockets.TcpClient TC;
  15.  
  16. [DllImport("kernel32.dll")]
  17. private static extern void ExitProcess(int a);
  18.  
  19. public static void Main() {
  20. talk = new Form();
  21. talk.Text = "TalkUser - The OFFICIAL TalkServ Client";
  22. talk.Closing += new CancelEventHandler(talk_Closing);
  23. talk.Controls.Add(new TextBox());
  24. talk.Controls[0].Dock = DockStyle.Fill;
  25. talk.Controls.Add(new TextBox());
  26. talk.Controls[1].Dock = DockStyle.Bottom;
  27. ((TextBox)talk.Controls[0]).Multiline = true;
  28. ((TextBox)talk.Controls[1]).Multiline = true;
  29. talk.WindowState = FormWindowState.Maximized;
  30. talk.Show();
  31. ((TextBox)talk.Controls[1]).KeyUp += new KeyEventHandler(key_up);
  32. TC = new N.Sockets.TcpClient();
  33. TC.Connect("IP OF A SERVER HERE",4296);
  34. Thread t = new Thread(new ThreadStart(run));
  35. t.Start();
  36. while(true) {
  37. Application.DoEvents();
  38. }
  39. }
  40.  
  41. private static void talk_Closing(object s, CancelEventArgs e) {
  42. e.Cancel = false;
  43. Application.Exit();
  44. ExitProcess(0);
  45. }
  46.  
  47. private static void key_up(object s,KeyEventArgs e) {
  48. TextBox TB = (TextBox)s;
  49. if(TB.Lines.Length>1) {
  50. StreamWriter SW = new StreamWriter(TC.GetStream());
  51. SW.WriteLine(TB.Text);
  52. SW.Flush();
  53. TB.Text = "";
  54. TB.Lines = null;
  55. }
  56. }
  57.  
  58. private static void run() {
  59. StreamReader SR = new StreamReader(TC.GetStream());
  60. while(true) {
  61. Application.DoEvents();
  62. TextBox TB = (TextBox)talk.Controls[0];
  63. TB.AppendText(SR.ReadLine()+"\r\n");
  64. TB.SelectionStart = TB.Text.Length;
  65. }
  66. }
  67. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(7,14): error CS0234: The type or namespace name `Windows' does not exist in the namespace `System'. Are you missing an assembly reference?
prog.cs(47,40): error CS0246: The type or namespace name `KeyEventArgs' could not be found. Are you missing a using directive or an assembly reference?
prog.cs(7,14): error CS0234: The type or namespace name `Windows' does not exist in the namespace `System'. Are you missing an assembly reference?
Compilation failed: 3 error(s), 0 warnings
stdout
Standard output is empty