示例#1
0
        /// <summary>
        /// Required designer variable.
        /// </summary>
        public Form1()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
            chatSer = new chatServer();
            //port = ConfigurationManager.AppSettings["ServerPort"];
            port = "9050";
            label4.Text = port;
            chatSer.port = Convert.ToInt32(port);
            chatSer.clientConnected += new clientConnectedHandler(showIDs);
            //list box 2
            idS = chatSer.fetchIDs();
            foreach(string item in idS)
            {
                if(item != null)
                {
                    listBox2.Items.Add(item);
                }
            }
        }
示例#2
0
 static void Main()
 {
     Application.EnableVisualStyles();
     Application.SetCompatibleTextRenderingDefault(false);
     Application.Run(new Form1());
     chatServer Ser = new chatServer();
     Ser.connectClients();
 }