Exemplo n.º 1
0
 public static void Init()
 {
     auc = new AsyncUdpClient();
 }
Exemplo n.º 2
0
 /// <summary>
 /// 广播
 /// </summary>
 public static void Clientmain()
 {
     auc = new AsyncUdpClient();
     auc.SendMsg(false);
     Console.Read();
 }
Exemplo n.º 3
0
 /// <summary>
 /// 广播
 /// </summary>
 public static void Clientmain()
 {
     auc = new AsyncUdpClient();
     auc.SendMsg(false);
     Console.Read();
 }
Exemplo n.º 4
0
 public static void Init()
 {
     auc = new AsyncUdpClient();
    
 } 
Exemplo n.º 5
0
        private void Form1_Load(object sender, EventArgs e)
        {
            picBox.Size = panel1.Size;
            IP = ConfigHelper.GetConfigString("IP");
            port = ConfigHelper.GetConfigInt("Port");

            string[] paths = ConfigHelper.GetConfigString("file").Split(new char[1] { '|' }, StringSplitOptions.RemoveEmptyEntries);
            foreach (string path in paths)
            {
                if (!string.IsNullOrEmpty(path))
                {
                    comboBox_fileselect.Items.Add(path);
                    comboBox_fileselect.SelectedItem = path;
                    if (System.IO.Path.GetExtension(path) == ".png" || System.IO.Path.GetExtension(path) == ".jpg")
                    {
                        lImg.Add(comboBox_fileselect.Items.Count - 1, Image.FromFile(path));
                    }
                }
            }
            
            //TCP连接
            //S = new NewSocket();
            //S.Init(IP, port);
            //timer2.Start();
            //UDP
            AUC = new AsyncUdpClient(IP, port, 10010);
            t = new Thread(DUPSocket);
            t.Start();
            timer3.Start();

            ShowIP_label.Text = "IP:" + IP.ToString() + "|Port:" + port;
        }