示例#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
 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();
 }