How do I get the Internet Explorer download histor

2019-09-19 00:13发布

Is there any way to get Downloads history of IE?

We get Downloads history of Firefox from downloads.sqlite file and we get download history of Chrome from history.sqlite file.

But how to find out in IE?

1条回答
Summer. ? 凉城
2楼-- · 2019-09-19 01:13

Try this piece of code snippet:

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;
    }
}

References:

  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#
查看更多
登录 后发表回答