简体   繁体   English

限制下载文件的大小WebBrowser C#WINFORMS

[英]limit download file size WebBrowser C# WINFORMS

I am building a webbrowser in WINFORMS C#. 我正在WINFORMS C#中构建一个Web浏览器。 I want to limit the download file size to under 25mb. 我想将下载文件的大小限制为25mb以下。 Is there any way to access the download file dialog fields which pops out when a download is detected. 有什么方法可以访问下载文件对话框,该字段在检测到下载时弹出。 Should I use webclient instead. 我应该改用webclient吗。 Please advice. 请指教。

Not easy, but you can do that by Implementing a Custom Download Manager 不容易,但是您可以通过实施自定义下载管理器实现

Sample implementation is done in The most complete C# Webbrowser wrapper control 最完整的C#Webbrowser包装器控件中完成示例实现

m_csexwbCOMLib.FileDownloadEx += new 
  ComUtilitiesLib._IUtilManEvents_FileDownloadExEventHandler(dl_FileDownloadEx);

void dl_FileDownloadEx(int dlUID, string sURL, string sFilename, 
     string sExt, string sFileSize, string sExtraHeaders, string sRedirURL, 
     ref bool SendProgressEvents, ref bool bStopDownload, ref string sPathToSave)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM