本文整理汇总了C#中WebDownload.request方法的典型用法代码示例。如果您正苦于以下问题:C# WebDownload.request方法的具体用法?C# WebDownload.request怎么用?C# WebDownload.request使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WebDownload
的用法示例。
在下文中一共展示了WebDownload.request方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: downloadDelegate_DecideDestinationWithSuggestedFilename
private void downloadDelegate_DecideDestinationWithSuggestedFilename(WebDownload download, string fileName)
{
download.setDeletesFileUponFailure(1);
if (string.IsNullOrEmpty(fileName) == false)
{
string url = download.request().url();
if (GlobalPreferences.WillHandleDownloadsManually)
{
FileDownloadBeginEventArgs args = new FileDownloadBeginEventArgs(download.request().url(), fileName, download);
DownloadBegin(this, args);
}
else
{
if (!(canornot == download))
{
canornot = download;
candownload = "yes";
}
else { canornot = null; }
if (!url.StartsWith("file://"))
foreach (Form hello in Application.OpenForms)
{
if (hello.Name == "MainDownloadForm")
{
candownload = "no";
}
}
if (candownload == "yes")
{
MyDownloader.App.UI.MainDownloadForm newd = new MyDownloader.App.UI.MainDownloadForm();
newd.Show();
newd.downloadList1.NewFileDownload(url, fileName, true, false);
}
else
{
((MyDownloader.App.UI.MainDownloadForm)Application.OpenForms["MainDownloadForm"]).Show();
((MyDownloader.App.UI.MainDownloadForm)Application.OpenForms["MainDownloadForm"]).downloadList1.NewFileDownload(url, fileName, true, false);
}
download.cancelForResume();
}
}
}