Example #1
0
 public Form1()
 {
     InitializeComponent();
     //为这个委托变量赋值
     changeProgerss = FunChangeProgress;
     changebtn      = FunChangebutton;
 }
Example #2
0
        /// <summary>
        /// 初始化
        /// </summary>
        private void Initil()
        {
            //添加图标
            imagelist           = new ImageList();
            imagelist.ImageSize = new Size(32, 32);
            imagelist.Images.Add(Properties.Resources.direct);
            imagelist.Images.Add(Properties.Resources.document);
            imagelist.Images.Add(Properties.Resources.download);
            imagelist.Images.Add(Properties.Resources.upload);


            imagelist.ColorDepth     = ColorDepth.Depth32Bit;
            listView1.LargeImageList = imagelist;

            //加密方式选择
            comboEncode.SelectedIndex = 1;

            //初始化线程
            downloads = new Thread(DownloadFile);
            uploads   = new Thread(UploadFile);

            //初始化委托
            changep1 = new ChangeProgress(ChangeP1);
            changep2 = new ChangeProgress(ChangeP2);

            //listview操作
            getName = new GetListView(GetListName);
            getType = new GetListView(GetListType);

            //
            btnDisCon.Enabled = false;

            //账号密码操作
            FtpData = new List <A_PS>();
            String temp = XmlHelper.getLastChoice();

            if (!temp.Equals(""))
            {
                LastLoginIP       = temp.Split(';')[0];
                LastSelectedIndex = Convert.ToInt32(temp.Split(';')[1]);

                XmlHelper.ReadAllDatas(LastLoginIP, ref FtpData);
                if (FtpData.Count > 0)
                {
                    FillCombAcc();
                    setAcctInfo();
                }
            }

            //获取保存路径
            LocalSavePath = XmlHelper.getSavePath();
            if (LocalSavePath.Equals(""))
            {
                LocalSavePath = "./FtpDownLoad";
            }
            label7.Text = LocalSavePath;
            comboEncode.SelectedIndex = 0;
        }
Example #3
0
 private void Web_DownloadProgressChangedEvent(object sender, ProgressChangedEventArgs e)
 {
     ChangeProgress?.Invoke(this, e);
 }