C#如何判断文件下载是否成功
System.IO.FileInfo toDownload = new System.IO.FileInfo(url路径);Response.Clear();
Response.AddHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(toDownload.Name));
Response.ContentType = "application/x-zip-compressed";
Response.TransmitFile(url路径);
Response.End();
可是成功下载,但没办法统计用户是否下载成功.要做有效的统计次数.
请高手帮忙解答.
谢谢 --------------------编程问答-------------------- System.IO.FileInfo toDownload = new System.IO.FileInfo(url路径);
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(toDownload.Name));
Response.ContentType = "application/x-zip-compressed";
Response.TransmitFile(url路径);
Response.End(); <-----运行到这里不就成功了吗?
在这之后进行count++的操作 --------------------编程问答-------------------- 运行是成功了
用户要是点取消
count++
也会执行的 --------------------编程问答-------------------- if(File.Exists(Path))
下載成功 --------------------编程问答-------------------- if(File.Exists(Path))
{
"成功"
}
补充:.NET技术 , C#