记录IE访问网络的历史。
IE的历史记录默认保存在
C:\Documents and Settings\Administrator\Local\Settings\History
目录下,这个目录下的文件夹和文件的属性比一般的文件夹和文件的属性多一些网络地址、访问次数等属性,可以说比较完整的记录了IE访问网络的情况,但是这个文件夹下的内容是和IE中的“网页保存在历史记录中的天数”选项相关。
那么有办法读取这些特殊的属性实现对IE访问网络历史的记录吗?
或者有相关资料可以查到IE记录其访问历史的方式吗?
IE是否提供了接口提供这些历史记录信息呢?
希望高手能够多多指点,不一定要完全解决,提供一些相关的参考资料也不胜感激!
问题点数:0、回复次数:10Top
1 楼neosu(CrazyNeo)回复于 2002-07-02 16:37:51 得分 0
C:\Documents and Settings\Administrator\Local\Settings\History\History.IE5
使用其他的工具看吧。下面有一些index.dat文件Top
2 楼agrintyro(逐日少年)回复于 2002-07-02 19:06:08 得分 0
能告诉我用什么工具吗?
我不知道你说的“其他工具”指什么?
谢谢!Top
3 楼neosu(CrazyNeo)回复于 2002-07-02 21:08:54 得分 0
我的意思是直接读取,因为只要用windows自己的工具看,就看不到真实的文件了。
用命令行dir一下先吧。Top
4 楼yleng(冷冷)回复于 2002-07-03 10:26:56 得分 0
ie会不会有各接口阿?探讨探讨Top
5 楼jiangsheng(蒋晟.Net[MVP])回复于 2002-07-03 10:52:33 得分 0
IUrlHistoryStg Interface
--------------------------------------------------------------------------------
This interface manages Microsoft® Internet Explorer history for the current user.
IUrlHistoryStg Members
AddUrl Places the specified URL into the history. If the URL does not exist in the history, an entry is created in the history. If the URL does exist in the history, it is overwritten.
BindToObject Not currently implemented.
DeleteUrl Deletes all instances of the specified URL from the history.
EnumUrls Returns an interface to an enumerator of the history's visited links.
QueryUrl Queries the history and reports whether the URL passed as the pocsUrl parameter has been visited by the current user.
IUrlHistoryStg2 Interface
--------------------------------------------------------------------------------
This interface provides additional features for managing the user's history.
IUrlHistoryStg2 Members
AddUrlAndNotify Provides an advanced method of adding a URL to the history.
ClearHistory Clears history on a per-user basis
Top
6 楼agrintyro(逐日少年)回复于 2002-07-03 13:36:18 得分 0
在MSDN中查不到IUrlHistoryStg这个接口,不知道哪位能告诉我去哪里找到这个接口的资料Top
7 楼jiangsheng(蒋晟.Net[MVP])回复于 2002-07-03 18:40:26 得分 0
msdn.microsoft.comTop
8 楼jiangsheng(蒋晟.Net[MVP])回复于 2002-07-04 12:36:41 得分 0
不会用的话,学学COM先
#include <UrlHist.h>
// Delete all items in History folder
HRESULT ClearHistory()
{
IUrlHistoryStg2* pUrlHistoryStg2 = NULL;
HRESULT hr = CoCreateInstance(CLSID_CUrlHistory,
NULL, CLSCTX_INPROC, IID_IUrlHistoryStg2,
(void**)&pUrlHistoryStg2);
if (SUCCEEDED(hr))
{
hr = pUrlHistoryStg2->ClearHistory();
pUrlHistoryStg2->DeleteUrl((LPOLESTR)_T("*.*"),1);
pUrlHistoryStg2->Release();
}
return hr;
}
Top
9 楼jiangsheng(蒋晟.Net[MVP])回复于 2002-07-08 21:19:32 得分 0
Dear Web Team,
Is there a way to access and modify a WebBrowser control's session history? I need to be able to obtain (and/or change) the URL and text description of the session history entries?
Any help you can provide will be appreciated.
George Loo
The Web Team Replies:
Starting with Internet Explorer 5.5, the WebBrowser control exposes this information to its host through a family of interfaces known as the travel log interfaces ("travel log" being the IE lingo for session history). These interfaces not only give a WebBrowser control access to all the URLs and titles in the history, but also provide a nifty enumeration interface to make traversal of the list that much easier. Now why you would want to go replacing user's history entries with alternate entries is beyond us, but for the purposes of this sample, we'll assume you're trying to replace potentially embarrassing URLs with much cooler ones—like replacing all occurrences of www.starlandvocalband.com or www.ghostdad.com with the much more satisfying http://msdn.microsoft.com/ie. To this end, here is some code that goes through the URLs the user has visited so far and performs just these substitutions:
HRESULT hr = S_OK;
IServiceProvider* pISP = NULL;
ITravelLogStg* pTLStg = NULL;
ITravelLogEntry* pTLEntry = NULL;
IEnumTravelLogEntry* pTLEnum = NULL;
if (FAILED(pWB->QueryInterface(IID_IServiceProvider, (void**) &pISP))
|| pISP == NULL)
goto Cleanup;
if (FAILED(pISP->QueryService(SID_STravelLogCursor, IID_ITravelLogStg, (void**) &pTLStg))
|| pTLStg == NULL)
goto Cleanup;
if (SUCCEEDED(pTLStg->EnumEntries(TLEF_RELATIVE_BACK, &pTLEnum)) && pTLEnum)
{
hr = pTLEnum->Next(1, &pTLEntry, NULL);
while (hr != S_FALSE)
{
LPOLESTR szURL;
if (SUCCEEDED(pTLEntry->GetURL(&szURL)) && szURL)
{
if (wcsstr(szURL, L"www.starlandvocalband.com") ||
wcsstr(szURL, L"www.ghostdad.com"))
{
ITravelLogEntry* pTLNewEntry = NULL;
hr = pTLStg->CreateEntry(L"http://msdn.microsoft.com/ie",
L"MSDN Online Internet Explorer Developer Center",
pTLEntry,
FALSE,
&pTLNewEntry);
hr = pTLStg->RemoveEntry(pTLEntry);
}
}
pTLEntry->Release();
pTLEntry = NULL;
hr = pTLEnum->Next(1, &pTLEntry, NULL);
}
}
Cleanup:
if (pTLStg)
pTLStg->Release();
if (pTLEnum)
pTLEnum->Release();
For the full specs on each of these interfaces, check out http://msdn.microsoft.comhttp://msdn.microsoft.com/workshop/browser/travellog/travellog.asp. "Sky rockets in flight…"
Top
10 楼Gladstone(大士)回复于 2002-10-17 18:15:48 得分 0
简单一点可以使用CopyFile()将index.dat文件拷贝出来。
可以创建一个文件Monitor, 每有Write,便作拷贝Top



