I had validated this.To download SSMS which is more than 500M+
 static void Main(string[] args)
{
string url = "https://go.microsoft.com/fwlink/?linkid=2108895&clcid=0x409";
DownloadBigFile(new Uri(url), "ssms.exe");
} static void DownloadBigFile(Uri url, string outputFilePath)
{
const int BUFFER_SIZE = * ;
using (var outputFileStream = File.Create(outputFilePath, BUFFER_SIZE))
{
var req = WebRequest.Create(url);
using (var response = req.GetResponse())
{
using (var responseStream = response.GetResponseStream())
{
var buffer = new byte[BUFFER_SIZE];
int bytesRead;
do
{
bytesRead = responseStream.Read(buffer, , BUFFER_SIZE);
outputFileStream.Write(buffer, , bytesRead);
} while (bytesRead > );
}
}
}
}

C# download big file的更多相关文章

  1. Unity3D发布WebPlayer时Failed to download data file解决方案

    今天发布WebPlayer时, 发现直接打开html是可以正常运行的, 但是通过iis访问的话就会报错: Failed to download data file. 一开始以为是防火墙, 后来发现不是 ...

  2. How to download a file with plus symbol(+) filename in IIS?

    How to download a file with plus symbol(+) filename in IIS? Original post link:https://www.cnblogs.c ...

  3. Unity 3D本地公布WebPlayer版时"Failed to download data file"解决方式

    watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvbGlzZW55YW5n/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA ...

  4. Pikachu-File Inclusion, Unsafe file download & Unsafe file upload

    Pikachu-File Inclusion, Unsafe file download & Unsafe file upload 文件包含漏洞 File Inclusion(文件包含漏洞)概 ...

  5. Download Excel file with Angular

    源码连接(编写中) 用Angular下载后台返回的Excel文件,用Blob实现,引用FileSaver.js 后台C#代码: [WebMethod] public static byte[] Cal ...

  6. how to download a file with Nodejs(without using third-party libraries)用node下载文件

    创建HTTP GET请求并将其管理response到可写文件流中: var http = require('http'); var fs = require('fs'); var file = fs. ...

  7. Unity 3D本地发布WebPlayer版时Failed to download data file解决方案

    遇到这个问题就是指Web服务器并没有支持这种*.unity3d文件类型.需要做的是在Web服务器中添加MIME类型: IIS 7 及以上版本: 在功能视图的IIS选项卡中: 双击打开MIME,选择添加 ...

  8. R包安装失败failed to download mirrors file

    在R console中使用install.packages()来安装第三方包时,会出现这样的错误: 即使我们选择的是China的镜像也解决不了问题. 这时候,可以先试试用IE打开上图中黑底部分的URL ...

  9. curl download zip file

    https://askubuntu.com/questions/285976/download-zip-file-with-curl-command

随机推荐

  1. R期望

    斐波那契数列--九九乘法表 # 1. 打印斐波那契数列 kl<-c(1,1) for (i in 1:8){ kl[i+2]<-kl[i]+kl[i+1] } kl # 10. 打印九九乘 ...

  2. composer中常用命令

    一些常用的composer命令: # 显示所有已经安装的包 composer show # 移除指定的依赖包package_name composer remove package_name # 搜索 ...

  3. idea实战技巧

    一.背景 为什么想写这个,因为编码一线更多的是实战,实战中,可能一个快捷键,一个小技巧,就能省很多时间. 本文会持续记录,持续更新. 二.技巧 1.全局替换(带正则) 场景是: 多profile的情况 ...

  4. PAT 1006 Sign In and Sign Out 查找元素

    At the beginning of every day, the first person who signs in the computer room will unlock the door, ...

  5. halcon 算子功能查找大全中文版(可直接下载)

    原文作者:aircraft 原文链接:https://www.cnblogs.com/DOMLX/p/11543364.html haicon算子中文查找大全百度云链接 链接:https://pan. ...

  6. Linux-打包压缩命令

    内容总结自<鸟哥的Linux私房菜>http://cn.linux.vbird.org/linux_basic/0240tarcompress.php 一.打包/压缩文件常见扩展名 *.g ...

  7. Web 安全总结

    同源策略 如果两个 URL 的协议.域名和端口都相同,我们就称这两个 URL 同源. 同源策略限制了来自不同源的 JavaScript 脚本对当前 DOM 对象读和写的操作. 同源策略限制了不同源的站 ...

  8. SAP SD如何将销售订单其它ITEM加入到一个已创建好的交货单里

    SAP SD如何将销售订单其它ITEM加入到一个已创建好的交货单里 如下的销售订单,有多个ITEM, 为其中的第一个ITEM创建了DN 80016362, 如果业务发现需要修改该交货单,将销售订单里的 ...

  9. ListenAndServe源码剖析

    使用goland追踪阅读ListenAndServe源码,剖析服务器启动流程 ListenAndServe阅读 func ListenAndServe(addr string, handler Han ...

  10. 38-docker managed volume

    docker managed volume 与 bind mount 在使用上的最大区别是不需要指定 mount 源,指明 mount point 就行了.还是以 httpd 容器为例: 我们通过 - ...