簡體   English   中英

如何獲取Internet Explorer的下載歷史記錄?

[英]How do I get the Internet Explorer download history?

有什么方法可以獲取IE的下載歷史記錄?

我們從downloads.sqlite文件中獲取Firefox的下載歷史記錄,並從history.sqlite文件中獲取Chrome的下載歷史記錄。

但是如何在IE中找到答案?

嘗試以下代碼片段:

public class InternetExplorer
{
    // List of URL objects
    public List<URL> URLs { get; set; }
    public IEnumerable<URL> GetHistory()
    {
        // Initiate main object
        UrlHistoryWrapperClass urlhistory = new UrlHistoryWrapperClass();

        // Enumerate URLs in History
        UrlHistoryWrapperClass.STATURLEnumerator enumerator =
        urlhistory.GetEnumerator();

        // Iterate through the enumeration
        while (enumerator.MoveNext())
        {
            // Obtain URL and Title
            string url = enumerator.Current.URL.Replace('\'', ' ');
            // In the title, eliminate single quotes to avoid confusion
            string title = string.IsNullOrEmpty(enumerator.Current.Title)
            ? enumerator.Current.Title.Replace('\'', ' ') : "";

            // Create new entry
            URL U = new URL(url, title, "Internet Explorer");

            // Add entry to list
            URLs.Add(U);
        }

        // Optional
        enumerator.Reset();

        // Clear URL History
        urlhistory.ClearHistory();

        return URLs;
    }
}

參考文獻:

  1. 如何在控件中顯示Internet Explorer的歷史記錄?
  2. 獲取C#中的Web瀏覽器歷史記錄
  3. 如何在C#中訪問Internet Explorer歷史記錄
  4. C#中的IE歷史記錄

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM