【问题标题】:How do I get the Internet Explorer download history?如何获取 Internet Explorer 下载历史记录?
【发布时间】:2012-10-30 05:40:31
【问题描述】:

有没有办法获取IE的下载历史?

我们从 downloads.sqlite 文件中获取 Firefox 的下载历史,从 history.sqlite 文件中获取 Chrome 的下载历史。

但是如何在 IE 中查找呢?

【问题讨论】:

    标签: c# .net internet-explorer


    【解决方案1】:

    试试这段代码sn-p:

    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. How to show Internet Explorer's History in a control?
    2. Get Web browser history in C#
    3. How to access Internet Explorer History in C#
    4. IE history in C#

    【讨论】:

    • 有没有办法在c++中得到它?
    猜你喜欢
    • 1970-01-01
    • 2010-12-03
    • 2011-08-25
    • 1970-01-01
    • 1970-01-01
    • 2014-11-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多