资源简介

用C#做的winform仿迅雷的网络下载程序,支持多线程,断点续传,本来还想用到数据池的,不过要做好好像还要弄很多东西,没时间弄了,先发上来,新手可以看看,大神用不上。

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace SimpleUploadDown
{
    public partial class DownForm : UserControl
    {
        public Dictionary _task = new Dictionary();

        public DownForm()
        {
            InitializeComponent();
            ImageList imgList = new ImageList();
            imgList.ImageSize = new Size(1 25);//分别是宽和高
            listView1.SmallImageList = imgList;
            //int y = 22;
            //for (int i = 0; i < 10; i++)
            //{
            //    Insert(i.ToString() y i + 1);
            //    y = y + 25 + 1;
            //}
        }

        public void Insert(string name ref int y ref int index LoadingBar lb)
        {
            ListViewItem item = new ListViewItem();
            item.Text = index.ToString();
            item.SubItems.Add(name);
            listView1.Items.Add(item);
            lb.Location = new Point(170 y);
            listView1.Controls.Add(lb);
            index++;
            y = y + 26;
        }

        delegate void dgDelete(int index LoadingBar lb);
        public void Delete(int index LoadingBar lb)
        {
            if (listView1.InvokeRequired)
            {
                dgDelete d = new dgDelete(Delete);
                listView1.Invoke(d new object[] { index lb });
            }
            else
            {
                listView1.Items.RemoveAt(index - 1);
                listView1.Controls.Remove(lb);
            }
        }

        private void tsStart_Click(object sender EventArgs e)
        {
            if (listView1.SelectedItems.Count > 0)
            {
                ListViewItem item = listView1.SelectedItems[0];
                string name = item.SubItems[1].Text;
                WebFileFunction wff = _task[name];
                wff._mResetEvent.Set();
            }
        }

        private void tsPause_Click(object sender EventArgs e)
        {
            if (listView1.SelectedItems.Count > 0)
            {
                ListViewItem item = listView1.SelectedItems[0];
                string name = item.SubItems[1].Text;
                WebFileFunction wff = _task[name];
                wff._mResetEvent.Reset();
            }
        }
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件        206  2014-09-22 14:08  SimpleUploadDown\AllDll\downinfo.xml

     文件        203  2014-09-18 09:33  SimpleUploadDown\AllDll\fileinfo.xml

     文件         62  2014-09-18 09:27  SimpleUploadDown\AllDll\finishinfo.xml

     文件      45056  2014-09-22 14:08  SimpleUploadDown\AllDll\SimpleUploadDown.exe

     文件      77312  2014-09-22 14:08  SimpleUploadDown\AllDll\SimpleUploadDown.pdb

     文件       5632  2005-11-11 22:25  SimpleUploadDown\AllDll\SimpleUploadDown.vshost.exe

     文件         83  2014-09-17 15:11  SimpleUploadDown\AllDll\复件 fileinfo.xml

     文件      28672  2014-09-17 14:22  SimpleUploadDown\SimpleUploadDown\bin\Debug\SimpleUploadDown.exe

     文件      52736  2014-09-17 14:22  SimpleUploadDown\SimpleUploadDown\bin\Debug\SimpleUploadDown.pdb

     文件      99872  2014-09-27 11:20  SimpleUploadDown\SimpleUploadDown\data\1.dat

     文件      99872  2014-11-30 16:11  SimpleUploadDown\SimpleUploadDown\data\Test#@@#.dat

     文件       2482  2014-09-22 14:07  SimpleUploadDown\SimpleUploadDown\DownForm.cs

     文件       6156  2014-09-19 11:01  SimpleUploadDown\SimpleUploadDown\DownForm.Designer.cs

     文件       8450  2014-09-19 11:01  SimpleUploadDown\SimpleUploadDown\DownForm.resx

     文件        357  2014-09-27 09:04  SimpleUploadDown\SimpleUploadDown\EndForm.cs

     文件       3022  2014-09-27 09:04  SimpleUploadDown\SimpleUploadDown\EndForm.Designer.cs

     文件       5814  2014-09-27 09:04  SimpleUploadDown\SimpleUploadDown\EndForm.resx

     文件       1224  2014-09-27 14:34  SimpleUploadDown\SimpleUploadDown\FileFunction.cs

     文件       1474  2014-09-22 10:25  SimpleUploadDown\SimpleUploadDown\Form1.cs

     文件       3661  2014-09-18 13:52  SimpleUploadDown\SimpleUploadDown\Form1.Designer.cs

     文件       5814  2014-09-18 13:52  SimpleUploadDown\SimpleUploadDown\Form1.resx

     文件       1128  2014-09-18 16:46  SimpleUploadDown\SimpleUploadDown\LoadingBar.cs

     文件       2418  2014-09-18 16:46  SimpleUploadDown\SimpleUploadDown\LoadingBar.Designer.cs

     文件       5814  2014-09-18 16:46  SimpleUploadDown\SimpleUploadDown\LoadingBar.resx

     文件       2241  2014-09-22 14:08  SimpleUploadDown\SimpleUploadDown\MainForm.cs

     文件       5441  2014-09-18 11:47  SimpleUploadDown\SimpleUploadDown\MainForm.Designer.cs

     文件       6012  2014-09-18 11:47  SimpleUploadDown\SimpleUploadDown\MainForm.resx

     文件       4480  2014-09-22 14:08  SimpleUploadDown\SimpleUploadDown\NewForm.cs

     文件       8828  2014-09-18 09:23  SimpleUploadDown\SimpleUploadDown\NewForm.Designer.cs

     文件       6022  2014-09-18 09:23  SimpleUploadDown\SimpleUploadDown\NewForm.resx

............此处省略36个文件信息

评论

共有 条评论