Example #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);
        }
Example #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();
 }
Example #3
0
 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();
 }