• 大小: 9.61MB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2023-10-17
  • 语言: C#
  • 标签: ASP.NET  网盘系统  

资源简介

基于ASP.NET的网盘系统在线文件管理模块开发,是一套完整开发网盘项目的系统,在线文件管理模块特点:1、全静态页面、执行效率高;2、使用AJAX技术,用户体验好;3、界面美观,全新的对话框;4、 操作简便,一个页面完成所有操作;5、 纯DIV布局,代码简便控制,难度高;6、 纯手工代码,功能扩展容易;7、抛弃传统“拖控件”做法,真正意义上的提高;8、项目结构简单,易于融入任何系统;

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.Web;

public static class DownloadFile
{
    public static void ResponseFile(string path HttpContext contextbool hasfileName)
    {
        context = HttpContext.Current;

        System.IO.Stream iStream = null;
        byte[] buffer = new Byte[10000];
        int length;
        long dataToRead;
        string filename;
        if (!hasfileName)
        {
            filename = System.IO.Path.GetFileName(path);
        }
        else
        {
            filename = “down_“ + DateTime.Now.ToString(“yyyyMMddHHmmss“)+“.zip“;
        }

        try
        {
            iStream = new System.IO.FileStream(path System.IO.FileMode.Open System.IO.FileAccess.Read System.IO.FileShare.Read);
            dataToRead = iStream.Length;
            context.Response.ContentType = “application/octet-stream“;
            context.Response.AddHeader(“Content-Disposition“ “attachment; filename=“ + HttpUtility.UrlEncode(filename System.Text.Encoding.UTF8));

            while (dataToRead > 0)
            {
                if (context.Response.IsClientConnected)
                {
                    length = iStream.Read(buffer 0 10000);
                    context.Response.OutputStream.Write(buffer 0 length);
                    context.Response.Flush();

                    buffer = new Byte[10000];
                    dataToRead = dataToRead - length;
                }
                else
                {
                    dataToRead = -1;
                }
            }
        }
        catch (Exception ex)
        {
            context.Response.Write(ex.Message);
        }
        finally
        {
            if (iStream != null)
            {
                iStream.Close();
            }
        }
    }


}

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

     文件     526336  2012-08-17 19:03  在线文件管理模块.ppt

     文件       1281  2012-08-14 20:01  素材\#download.zip

     文件       1091  2012-08-14 20:55  素材\Ajax.js

     文件       1386  2008-12-25 08:58  素材\css\WebExplorer.css

     文件       9315  2012-08-14 20:56  素材\Dialog.js

     文件     229376  2008-07-14 15:08  素材\dll\ActiproSoftware.CodeHighlighter.Net20.dll

     文件     229376  2008-07-14 15:02  素材\dll\ActiproSoftware.Shared.Net20.dll

     文件      17408  2008-07-14 15:08  素材\dll\CodeHighlighterTest.dll

     文件      45056  2008-07-26 14:53  素材\dll\FredCK.FCKeditorV2.dll

     文件     143360  2008-09-28 18:36  素材\dll\ICSharpCode.SharpZipLib.dll

     文件        236  2008-08-05 11:40  素材\fckeditor\editor\css\behaviors\disablehandles.htc

     文件        822  2008-08-05 11:40  素材\fckeditor\editor\css\behaviors\showtableborders.htc

     文件       2648  2008-07-15 09:25  素材\fckeditor\editor\css\fck_editorarea.css

     文件       4145  2008-03-25 10:46  素材\fckeditor\editor\css\fck_internal.css

     文件       1696  2008-02-24 12:00  素材\fckeditor\editor\css\fck_showtableborders_gecko.css

     文件        288  2008-08-05 11:40  素材\fckeditor\editor\css\images\block_address.png

     文件        293  2008-08-05 11:40  素材\fckeditor\editor\css\images\block_blockquote.png

     文件        229  2008-08-05 11:40  素材\fckeditor\editor\css\images\block_div.png

     文件        218  2008-08-05 11:40  素材\fckeditor\editor\css\images\block_h1.png

     文件        220  2008-08-05 11:40  素材\fckeditor\editor\css\images\block_h2.png

     文件        219  2008-08-05 11:40  素材\fckeditor\editor\css\images\block_h3.png

     文件        229  2008-08-05 11:40  素材\fckeditor\editor\css\images\block_h4.png

     文件        236  2008-08-05 11:40  素材\fckeditor\editor\css\images\block_h5.png

     文件        216  2008-08-05 11:40  素材\fckeditor\editor\css\images\block_h6.png

     文件        205  2008-08-05 11:40  素材\fckeditor\editor\css\images\block_p.png

     文件        223  2008-08-05 11:40  素材\fckeditor\editor\css\images\block_pre.png

     文件        184  2008-08-05 11:40  素材\fckeditor\editor\css\images\fck_anchor.gif

     文件        599  2008-08-05 11:40  素材\fckeditor\editor\css\images\fck_flashlogo.gif

     文件        105  2008-08-05 11:40  素材\fckeditor\editor\css\images\fck_hiddenfield.gif

     文件         54  2008-08-05 11:40  素材\fckeditor\editor\css\images\fck_pagebreak.gif

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

评论

共有 条评论