• 大小: 42KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-05-09
  • 语言: C#
  • 标签: C#  断点续传  

资源简介

使用HTTP实现断点续传功能 包括客户端代码、服务器端整套项目代码

资源截图

代码片段和文件信息

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

namespace UpLoadClient
{
    public partial class frmUpLoad : Form
    {
        public frmUpLoad()
        {
            InitializeComponent();
        }

        private void btnUpLoad_Click(object sender EventArgs e)
        {
            string msg = ““;
            string fileName = this.txtFile.Text;
            UpLoadLib.serverPath = this.txtServer.Text;

            if (String.IsNullOrEmpty(fileName))
            {
                MessageBox.Show(“请选择要上传的文件!“);
                return;
            }

            int byteCount = 100 * 1024;

            if (UpLoadLib.UpLoadFile(fileName byteCount out msg))
            {
                MessageBox.Show(“文件上传成功!“);
            }
            else
            {

                MessageBox.Show(msg);
            }
        }

        private void btnSelect_Click(object sender EventArgs e)
        {
            if (this.openFileDialog1.ShowDialog() == DialogResult.OK)
            {
                this.txtFile.Text = this.openFileDialog1.FileName;
            }
        }

        private void btn100_Click(object sender EventArgs e)
        {
            string msg = ““;
            string fileName = this.txtFile.Text;
            UpLoadLib.serverPath = this.txtServer.Text;

            if (String.IsNullOrEmpty(fileName))
            {
                MessageBox.Show(“请选择要上传的文件!“);
                return;
            }


            int byteCount = 100 * 1024;
            if (UpLoadLib.UpLoadFileTest(fileName byteCount out msg))
            {
                MessageBox.Show(“文件前100K,上传成功!“);
            }
            else
            {

                MessageBox.Show(msg);
            }
        }

       
    }
}

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

     文件      24576  2010-07-30 14:39  UpLoadClient\bin\Debug\UpLoadClient.exe

     文件      28160  2010-07-30 14:39  UpLoadClient\bin\Debug\UpLoadClient.pdb

     文件       5632  2005-11-11 22:25  UpLoadClient\bin\Debug\UpLoadClient.vshost.exe

     文件       2017  2010-07-30 14:29  UpLoadClient\frmUpLoad.cs

     文件       5678  2010-07-30 14:20  UpLoadClient\frmUpLoad.Designer.cs

     文件       6017  2010-07-30 14:20  UpLoadClient\frmUpLoad.resx

     文件        846  2010-07-30 14:39  UpLoadClient\obj\Debug\UpLoadClient.csproj.GenerateResource.Cache

     文件      24576  2010-07-30 14:39  UpLoadClient\obj\Debug\UpLoadClient.exe

     文件        180  2010-07-30 14:39  UpLoadClient\obj\Debug\UpLoadClient.frmUpLoad.resources

     文件      28160  2010-07-30 14:39  UpLoadClient\obj\Debug\UpLoadClient.pdb

     文件        180  2010-07-30 14:39  UpLoadClient\obj\Debug\UpLoadClient.Properties.Resources.resources

     文件        307  2010-07-30 14:39  UpLoadClient\obj\UpLoadClient.csproj.FileList.txt

     文件        475  2010-07-30 14:19  UpLoadClient\Program.cs

     文件       1196  2010-07-29 16:18  UpLoadClient\Properties\AssemblyInfo.cs

     文件       2878  2010-07-29 16:18  UpLoadClient\Properties\Resources.Designer.cs

     文件       5612  2010-07-29 16:18  UpLoadClient\Properties\Resources.resx

     文件       1095  2010-07-29 16:18  UpLoadClient\Properties\Settings.Designer.cs

     文件        249  2010-07-29 16:18  UpLoadClient\Properties\Settings.settings

     文件       3360  2010-07-30 14:19  UpLoadClient\UpLoadClient.csproj

     文件       8089  2010-07-30 14:38  UpLoadClient\UpLoadLib.cs

     文件       1106  2010-07-30 14:39  UpLoadClient\说明.txt

     文件        518  2010-07-29 16:17  UpLoadServer\Default.aspx

     文件        383  2005-09-07 09:40  UpLoadServer\Default.aspx.cs

     文件        112  2010-07-29 17:23  UpLoadServer\GetFileLength.aspx

     文件       1497  2010-07-30 14:14  UpLoadServer\GetFileLength.aspx.cs

     文件        104  2010-07-29 16:56  UpLoadServer\UpLoadSer.aspx

     文件       2015  2010-07-30 14:00  UpLoadServer\UpLoadSer.aspx.cs

     文件        110  2010-07-30 11:34  UpLoadServer\UpLoadSer100.aspx

     文件       1812  2010-07-30 14:36  UpLoadServer\UpLoadSer100.aspx.cs

     文件       1546  2010-07-30 14:30  UpLoadServer\Web.Config

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

评论

共有 条评论