Пример #1
0
 /// <summary>
 /// 发送文件
 /// </summary>
 /// <param name="code"></param>
 public static void UploadFile(BaseCommunication sender, FileCode code)
 {
     code.Head = CodeHead.SEND_FILE;
     code.readFile();
     if (sender != null)
     {
         sender.SendCode(code);
     }
 }
Пример #2
0
        /// <summary>
        ///  发送文件
        /// </summary>
        /// <param name="fileName"></param>
        public static void ReadyUploadFile(BaseCommunication sender, string fileName, string savepath)
        {
            FileCode fileMng = new FileCode(fileName);

            fileMng.Head     = CodeHead.SEND_FILE;
            fileMng.SavePath = savepath;
            fileMng.readFile();
            if (sender != null)
            {
                sender.SendCode(fileMng);
            }
        }