zoukankan      html  css  js  c++  java
  • .NET将服务器文件导出

        导出文件:
                    string filePath = Server.UrlDecode(filePath);
                    if (File.Exists(filePath))
                    {
                        FileInfo fi = new FileInfo(filePath);
                        Response.Clear();
                        Response.ClearHeaders();
                        Response.Buffer = false;
                        Response.AppendHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(Path.GetFileName(filePath), System.Text.Encoding.UTF8));
                        Response.AppendHeader("Content-Length", fi.Length.ToString());
                        Response.ContentType = "application/octet-stream";
                        Response.WriteFile(filePath);
                        Response.Flush();
                        Response.End();
                    }

  • 相关阅读:
    Eclipse 如何安装反编译插件
    java下执行mongodb
    如何利用Xshell在Linux下安装jdk
    asp.net signalR
    手机抓包 fiddler magicwifi
    NServiceBus 消息
    .net 异步函数 Async await
    .net 任务(Task)
    .net 线程基础 ThreadPool 线程池
    .net 序列化反序列化
  • 原文地址:https://www.cnblogs.com/johnblogs/p/6709074.html
Copyright © 2011-2022 走看看