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

资源简介

c# 实现文件断点上传 使用文件流的方式进行断点上传 也可以使用web作为上传服务器实现

资源截图

代码片段和文件信息

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

namespace client
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void btnUpLoad_Click(object sender EventArgs e)
        {
            string msg = ““;
            string fileName = this.txtFile.Text;
            UpLoadLib.serverPath = “http://192.190.1.212:8067/Default.aspx“;

            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;
            }
        }
    }
}

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

     文件       4456  2013-02-22 10:32  DuanDanUploadTest\DuanDanUploadTest\Account\ChangePassword.aspx

     文件        355  2013-02-22 10:32  DuanDanUploadTest\DuanDanUploadTest\Account\ChangePassword.aspx.cs

     文件        845  2013-02-22 10:32  DuanDanUploadTest\DuanDanUploadTest\Account\ChangePassword.aspx.designer.cs

     文件        514  2013-02-22 10:32  DuanDanUploadTest\DuanDanUploadTest\Account\ChangePasswordSuccess.aspx

     文件        362  2013-02-22 10:32  DuanDanUploadTest\DuanDanUploadTest\Account\ChangePasswordSuccess.aspx.cs

     文件        479  2013-02-22 10:32  DuanDanUploadTest\DuanDanUploadTest\Account\ChangePasswordSuccess.aspx.designer.cs

     文件       3078  2013-02-22 10:32  DuanDanUploadTest\DuanDanUploadTest\Account\Login.aspx

     文件        475  2013-02-22 10:32  DuanDanUploadTest\DuanDanUploadTest\Account\Login.aspx.cs

     文件       1164  2013-02-22 10:32  DuanDanUploadTest\DuanDanUploadTest\Account\Login.aspx.designer.cs

     文件       5702  2013-02-22 10:32  DuanDanUploadTest\DuanDanUploadTest\Account\Register.aspx

     文件        917  2013-02-22 10:32  DuanDanUploadTest\DuanDanUploadTest\Account\Register.aspx.cs

     文件       1205  2013-02-22 10:32  DuanDanUploadTest\DuanDanUploadTest\Account\Register.aspx.designer.cs

     文件        347  2013-02-22 10:32  DuanDanUploadTest\DuanDanUploadTest\Account\Web.config

     文件       1339  2013-02-22 10:32  DuanDanUploadTest\DuanDanUploadTest\Properties\AssemblyInfo.cs

     文件     239835  2013-02-22 10:32  DuanDanUploadTest\DuanDanUploadTest\scripts\jquery-1.4.1-vsdoc.js

     文件     168792  2013-02-22 10:32  DuanDanUploadTest\DuanDanUploadTest\scripts\jquery-1.4.1.js

     文件      71922  2013-02-22 10:32  DuanDanUploadTest\DuanDanUploadTest\scripts\jquery-1.4.1.min.js

     文件       4258  2013-02-22 10:32  DuanDanUploadTest\DuanDanUploadTest\styles\Site.css

     文件        171  2013-02-22 10:32  DuanDanUploadTest\DuanDanUploadTest\Default.aspx

     文件       3399  2013-02-26 09:42  DuanDanUploadTest\DuanDanUploadTest\Default.aspx.cs

     文件        474  2013-02-22 10:32  DuanDanUploadTest\DuanDanUploadTest\Default.aspx.designer.cs

     文件        101  2013-02-22 10:32  DuanDanUploadTest\DuanDanUploadTest\Global.asax

     文件       1210  2013-02-22 10:32  DuanDanUploadTest\DuanDanUploadTest\Global.asax.cs

     文件       2280  2013-02-22 10:32  DuanDanUploadTest\DuanDanUploadTest\Site.Master

     文件        349  2013-02-22 10:32  DuanDanUploadTest\DuanDanUploadTest\Site.Master.cs

     文件       2577  2013-02-22 10:32  DuanDanUploadTest\DuanDanUploadTest\Site.Master.designer.cs

     文件       1989  2013-02-22 10:32  DuanDanUploadTest\DuanDanUploadTest\Web.config

     文件       1223  2013-02-22 10:32  DuanDanUploadTest\DuanDanUploadTest\Web.Debug.config

     文件       1284  2013-02-22 10:32  DuanDanUploadTest\DuanDanUploadTest\Web.Release.config

     文件       6800  2013-02-22 14:21  DuanDanUploadTest\DuanDanUploadTest\DuanDanUploadTest.csproj

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

评论

共有 条评论

相关资源