/// <summary>
/// 下载文件,若存在文件,覆盖该文件
/// </summary>
/// <param name="sourceFileUrl"></param>
/// <param name="desFile"></param>
/// <returns></returns>
public static bool DownloadFile(string sourceFileUrl, string desFile)
{
bool flag = false;
long SPosition = 0;
FileStream FStream = null;
Stream myStream = null;
sourceFileUrl = System.Web.HttpUtility.UrlPathEncode(sourceFileUrl);
string tmpFile = desFile + ".tmp";
try
{
if (File.Exists(desFile))
{
File.Delete(desFile);
}
}
catch { }
if (!Directory.Exists(Path.GetDirectoryName(desFile)))
{
Director
C# http下载大文件,支持断点下载
最新推荐文章于 2024-12-12 15:11:23 发布

最低0.47元/天 解锁文章
164

被折叠的 条评论
为什么被折叠?



