資源簡介
除了 WebClient 我們還可以使用一組 WindowsAPI 來完成下載任務。這就是 Windows Internet,簡稱 WinINet
代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.ComponentModel;
using?System.Diagnostics;
using?System.IO;
using?System.Linq;
using?System.Net;
using?System.Security.Permissions;
using?System.Text;
namespace?WinInetDemo3
{
????internal?class?DownloadManager?:?IDisposable
????{
????????private?bool?_cancelInstall?=?false;
????????private?Stopwatch?_downloadStopWatch?=?null;
????????private?MyWinInet?_winInet?=?null;
????????private?int?_currentDownloadTotalBytes?=?0;
????????private?int?_currentDownloadBytesSinceStopWatch?=?0;
????????private?BackgroundWorker?_bgWorker?=?null;
????????internal?MyWinInet?MyWinInet
????????{
????????????get
????????????{
????????????????if?(this._winInet?==?null)
????????????????{
????????????????????this._winInet?=?n
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2017-05-30?09:53??WinInetDemo\
?????文件????????1002??2017-05-30?09:57??WinInetDemo3.sln
?????目錄???????????0??2017-05-30?09:53??WinInetDemo\.vs\
?????目錄???????????0??2017-05-30?09:53??WinInetDemo\.vs\WinInetDemo3\
?????目錄???????????0??2017-05-30?09:53??WinInetDemo\.vs\WinInetDemo3\v14\
?????目錄???????????0??2017-05-30?09:53??WinInetDemo\bin\
?????目錄???????????0??2017-05-30?10:02??WinInetDemo\bin\Debug\
?????文件??????????96??2017-05-30?09:57??WinInetDemo\bin\Debug\log.txt
?????文件???????22016??2017-05-30?09:56??WinInetDemo\bin\Debug\WinInetDemo3.exe
?????文件???????56832??2017-05-30?09:56??WinInetDemo\bin\Debug\WinInetDemo3.pdb
?????文件???????22688??2017-05-30?09:56??WinInetDemo\bin\Debug\WinInetDemo3.vshost.exe
?????文件?????????490??2016-07-16?19:44??WinInetDemo\bin\Debug\WinInetDemo3.vshost.exe.manifest
?????文件????????5541??2016-04-21?20:07??WinInetDemo\DownloadManager.cs
?????文件????????3342??2016-04-25?09:25??WinInetDemo\DownloadProcessForm.cs
?????文件????????3848??2016-04-21?19:07??WinInetDemo\DownloadProcessForm.Designer.cs
?????文件????????5817??2016-04-21?19:07??WinInetDemo\DownloadProcessForm.resx
?????文件?????????547??2016-04-21?19:06??WinInetDemo\Form1.cs
?????文件????????2127??2016-04-21?19:06??WinInetDemo\Form1.Designer.cs
?????文件????????5817??2016-04-21?19:06??WinInetDemo\Form1.resx
?????文件????????1197??2016-04-21?08:45??WinInetDemo\Log.cs
?????文件???????15248??2016-04-25?09:24??WinInetDemo\MyWinInet.cs
?????文件????????1706??2016-04-21?20:12??WinInetDemo\NativeMethods.cs
?????目錄???????????0??2017-05-30?09:53??WinInetDemo\obj\
?????目錄???????????0??2017-05-30?09:57??WinInetDemo\obj\Debug\
?????文件?????????864??2017-05-30?09:57??WinInetDemo\obj\Debug\DesignTimeResolveAssemblyReferences.cache
?????文件????????6896??2017-05-30?09:53??WinInetDemo\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
?????目錄???????????0??2017-05-30?09:53??WinInetDemo\obj\Debug\TempPE\
?????文件?????????871??2017-05-30?09:56??WinInetDemo\obj\Debug\WinInetDemo3.csproj.FileListAbsolute.txt
?????文件????????1084??2017-05-30?09:56??WinInetDemo\obj\Debug\WinInetDemo3.csproj.GenerateResource.Cache
?????文件????????2210??2017-05-30?09:56??WinInetDemo\obj\Debug\WinInetDemo3.csprojResolveAssemblyReference.cache
?????文件?????????180??2017-05-30?09:56??WinInetDemo\obj\Debug\WinInetDemo3.DownloadProcessForm.resources
............此處省略13個文件信息
- 上一篇:C# WebClient實現文件
- 下一篇:C# 文件之斷點續傳
評論
共有 條評論