当前位置: 首页>>代码示例>>C#>>正文


C# WebDownload类代码示例

本文整理汇总了C#中WebDownload的典型用法代码示例。如果您正苦于以下问题:C# WebDownload类的具体用法?C# WebDownload怎么用?C# WebDownload使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


WebDownload类属于命名空间,在下文中一共展示了WebDownload类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: NotifyDecideDestinationWithSuggestedFilename

 internal void NotifyDecideDestinationWithSuggestedFilename(WebDownload download, string fileName)
 {
     if (FilePath.Length != 0)
         download.setDestination(FilePath, 1);
     else
         download.setDestination(fileName, 1);
 }
开发者ID:qcjxberin,项目名称:webkitdotnet,代码行数:7,代码来源:WebKitDownload.cs

示例2: Setup

 public void Setup()
 {
     MockBuild buildEngine = new MockBuild();
     testDirectory = TaskUtility.makeTestDirectory(buildEngine);
     task = new WebDownload();
     task.BuildEngine = new MockBuild();
 }
开发者ID:trippleflux,项目名称:jezatools,代码行数:7,代码来源:WebDownloadTest.cs

示例3: PackageDownload

		public PackageDownload(string urlRoot, string displayName, Hash hash, SpringPaths paths)
		{
			this.paths = paths;
			this.urlRoot = urlRoot;
			pool = new Pool(paths);

			PackageHash = hash;
			Name = displayName;
			fileListWebGet = new WebDownload();
		}
开发者ID:ParzivalX,项目名称:Zero-K-Infrastructure,代码行数:10,代码来源:PackageDownload.cs

示例4: WebDownloadExecute

        public void WebDownloadExecute()
        {
            WebDownload task = new WebDownload();
            task.BuildEngine = new MockBuild();
            task.FileUri = "http://www.microsoft.com/default.aspx";
            string downloadFile = Path.Combine(testDirectory, "microsoft.html");
            task.FileName = downloadFile;
            Assert.IsTrue(task.Execute(), "Execute Failed");

            Assert.IsTrue(File.Exists(downloadFile), "No download file");
        }
开发者ID:jacderida,项目名称:JobSystem,代码行数:11,代码来源:WebDownloadTest.cs

示例5: PassArguments

        public void PassArguments(string filename, Int64 filesize, WebDownload d)
        {

            this.Size = filesize;
            this.File = filename;
            this.download = d;
            this.FileForDownloading = filename + ".download";
            label5.Text = "Size: " + Size.ToString();
            label2.Text = Path.GetFileName(File);
            progressBar1.Maximum = Convert.ToInt32(filesize);
            progressBar1.Minimum = 0;
            UpdateProgress.Enabled = true;
        }
开发者ID:runt18,项目名称:open-webkit-sharp,代码行数:13,代码来源:DownloadForm.cs

示例6: gv_RowCommand

    protected void gv_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        Int32 index = 0;
        if (!Int32.TryParse("" + e.CommandArgument, out index)) index = -1;
        Int32 id = index >= 0 ? (Int32)gv.DataKeys[index][0] : 0;
        DataModel md = DataModel.FindByID(id);

        if (md != null)
        {
            if (e.CommandName == "ExportXml")
            {
                String xml = md.ExportXml();
                if (!String.IsNullOrEmpty(xml))
                {
                    //MemoryStream ms = new MemoryStream();
                    //EntityAccessorFactory.Create(EntityAccessorTypes.Xml)
                    //    .SetConfig(EntityAccessorOptions.Stream, ms)
                    //    .Write(md, null);
                    //ms.Position = 0;
                    WebDownload wd = new WebDownload();
                    MemoryStream ms = new MemoryStream(Encoding.UTF8.GetBytes(xml));
                    wd.Stream = ms;
                    wd.FileName = md.Name + ".xml";
                    wd.Mode = WebDownload.DispositionMode.Attachment;
                    wd.Render();
                    Response.End();
                }
            }
            else if (e.CommandName == "ExportZip")
            {
                MemoryStream ms = new MemoryStream();
                md.ExportZip(ms);

                WebDownload wd = new WebDownload();
                wd.Stream = ms;
                wd.FileName = md.Name + ".zip";
                wd.Mode = WebDownload.DispositionMode.Attachment;
                wd.Render();
                Response.End();
            }
        }
    }
开发者ID:windygu,项目名称:asxinyunet,代码行数:42,代码来源:DataModel.aspx.cs

示例7: 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();
                }
            }
        }
开发者ID:vebin,项目名称:webkit2.net,代码行数:43,代码来源:WebKitBrowser.cs

示例8: downloadDelegate_DidReceiveResponse

 private void downloadDelegate_DidReceiveResponse(WebDownload download, WebURLResponse response)
 {
     downloads[download].NotifyDidReceiveResponse(download, response);
 }
开发者ID:tsupo,项目名称:webkitdotnet,代码行数:4,代码来源:WebKitBrowserCore.cs

示例9: downloadDelegate_DecideDestinationWithSuggestedFilename

 private void downloadDelegate_DecideDestinationWithSuggestedFilename(WebDownload download, string fileName)
 {
     downloads[download].NotifyDecideDestinationWithSuggestedFilename(download, fileName);
 }
开发者ID:tsupo,项目名称:webkitdotnet,代码行数:4,代码来源:WebKitBrowserCore.cs

示例10: downloadDelegate_DidFinish

 private void downloadDelegate_DidFinish(WebDownload download)
 {
     downloads[download].NotifyDidFinish(download);
     // remove from list
     downloads.Remove(download);
 }
开发者ID:tsupo,项目名称:webkitdotnet,代码行数:6,代码来源:WebKitBrowserCore.cs

示例11: willSendRequest

 public void willSendRequest(WebDownload download, WebMutableURLRequest request, WebURLResponse redirectResponse, out WebMutableURLRequest finalRequest)
 {
     finalRequest = request;
 }
开发者ID:duponamk,项目名称:webkitdotnet,代码行数:4,代码来源:WebDownloadDelegate.cs

示例12: willResumeWithResponse

 public void willResumeWithResponse(WebDownload download, WebURLResponse response, long fromByte)
 {
     WillResumeWithResponse(download, response, fromByte);
 }
开发者ID:duponamk,项目名称:webkitdotnet,代码行数:4,代码来源:WebDownloadDelegate.cs

示例13: shouldDecodeSourceDataOfMIMEType

 public int shouldDecodeSourceDataOfMIMEType(WebDownload download, string encodingType)
 {
     // TODO
     return 0;
 }
开发者ID:duponamk,项目名称:webkitdotnet,代码行数:5,代码来源:WebDownloadDelegate.cs

示例14: didReceiveResponse

 public void didReceiveResponse(WebDownload download, WebURLResponse response)
 {
     DidReceiveResponse(download, response);
 }
开发者ID:duponamk,项目名称:webkitdotnet,代码行数:4,代码来源:WebDownloadDelegate.cs

示例15: didReceiveDataOfLength

 public void didReceiveDataOfLength(WebDownload download, uint length)
 {
     DidReceiveDataOfLength(download, length);
 }
开发者ID:duponamk,项目名称:webkitdotnet,代码行数:4,代码来源:WebDownloadDelegate.cs


注:本文中的WebDownload类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。