예제 #1
0
        private void SendFileForm_Load(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(remoteUsername))
            {
                return;
            }

            if (remoteIPEndPoint == null)
            {
                return;
            }

            udpSendFile = new UdpSendFile(
                remoteIPEndPoint.Address.ToString(),
                10002,
                10002);
            //sendFile.Log += new TraFransfersFileLogEventHandler(SendFileLog);
            udpSendFile.FileSendBuffer +=
                new FileSendBufferEventHandler(FileSendBuffer);
            udpSendFile.FileSendAccept +=
                new FileSendEventHandler(FileSendAccept);
            udpSendFile.FileSendRefuse +=
                new FileSendEventHandler(FileSendRefuse);
            udpSendFile.FileSendCancel   += new FileSendEventHandler(FileSendCancel);
            udpSendFile.FileSendComplete +=
                new FileSendEventHandler(FileSendComplete);
            udpSendFile.Start();
//            AppendLog(string.Format(
//                "开始侦听,端口:{0}", udpSendFile.Port), false);
        }
예제 #2
0
파일: Form1.cs 프로젝트: royalvald/UDPTest
 private void button2_Click(object sender, EventArgs e)
 {
     sendFile = new UdpSendFile(
         tbRemoteIP.Text,
         int.Parse(tbRemotePort.Text),
         int.Parse(tbLocalPort.Text));
     sendFile.Start();
 }
예제 #3
0
파일: SendFileForm.cs 프로젝트: Ato42/CMS
 public SendFileForm()
 {
     InitializeComponent();
     udpSendFile = new UdpSendFile("127.0.0.1", 10003, 10002);
     udpSendFile.FileSendBuffer +=
         new FileSendBufferEventHandler(FileSendBuffer);
     udpSendFile.FileSendAccept +=
         new FileSendEventHandler(FileSendAccept);
     udpSendFile.FileSendRefuse +=
         new FileSendEventHandler(FileSendRefuse);
     udpSendFile.FileSendCancel   += new FileSendEventHandler(FileSendCancel);
     udpSendFile.FileSendComplete +=
         new FileSendEventHandler(FileSendComplete);
     udpSendFile.Start();
 }