Beispiel #1
0
 /// <summary>
 /// 初始化ftp信息
 /// </summary>
 /// <param name="server"></param>
 private void initFtp(Entity.Pe_serverinfo server)
 {
     FTP.FtpConfig ftpConfig = new Ftp.FtpConfig()
     {
         str_FtpUri      = server.Serverip,
         int_FtpPort     = (int)server.Port,
         str_FtpUserID   = server.Ftpusername,
         str_FtpPassword = server.Pwd,
         int_RetryTimes  = 3
     };
     ftp_server_mainpath = server.Path.ToLower().Replace($"http://{server.Serverip}/", "");
     if (ftp_server_mainpath.EndsWith("/"))
     {
         ftp_server_mainpath = ftp_server_mainpath.Substring(0, ftp_server_mainpath.Length - 1);
     }
     for (int i = 0; i < limit_upload_count; i++)
     {
         ftp_client_list.Add(new Ftp.FtpHelper(ftpConfig));
     }
 }
Beispiel #2
0
 private void init_config()
 {
     Task.Run(() =>
     {
         this.Invoke(new delegate_updatetxt(update_bak_txt), "正在请求配置信息");
         server_Config = GetLocalConfig.get_client_config();
         this.Invoke(new delegate_updatetxt(update_bak_txt), "已获取配置信息,马上加载界面");
         if (server_Config != null)
         {
             this.Invoke(new delegate_updatetxt(update_upload_txt), "正在请求上传服务器配置信息");
             pe_Serverinfo = GetLocalConfig.get_serverinfo(server_Config.server_name);
             create_file_path(server_Config.backup_path);
             limit_upload_count = server_Config.upload_parallel;
             this.Invoke(new delegate_updatetxt(update_upload_txt), $"请求上传服务器配置信息成功,服务器名称[{pe_Serverinfo.Servername}]");
             this.initFtp(pe_Serverinfo);
             isupload = true;
             isload   = true;
         }
     });
 }