【发布时间】:2012-10-30 05:40:31
【问题描述】:
有没有办法获取IE的下载历史?
我们从 downloads.sqlite 文件中获取 Firefox 的下载历史,从 history.sqlite 文件中获取 Chrome 的下载历史。
但是如何在 IE 中查找呢?
【问题讨论】:
标签: c# .net internet-explorer
有没有办法获取IE的下载历史?
我们从 downloads.sqlite 文件中获取 Firefox 的下载历史,从 history.sqlite 文件中获取 Chrome 的下载历史。
但是如何在 IE 中查找呢?
【问题讨论】:
标签: c# .net internet-explorer
试试这段代码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;
}
}
参考资料:
【讨论】: