zoukankan
html css js c++ java
用API获取IE缓存文件
//
using system.runtime.interopservices;
[structlayout(layoutkind.sequential, charset
=
charset.auto)]
public
struct
internet_cache_entry_info
...
{
public
int
dwstructsize;
public
intptr lpszsourceurlname;
public
intptr lpszlocalfilename;
public
int
cacheentrytype;
public
int
dwusecount;
public
int
dwhitrate;
public
int
dwsizelow;
public
int
dwsizehigh;
public
filetime lastmodifiedtime;
public
filetime expiretime;
public
filetime lastaccesstime;
public
filetime lastsynctime;
public
intptr lpheaderinfo;
public
int
dwheaderinfosize;
public
intptr lpszfileextension;
public
int
dwexemptdelta;
}
[dllimport(
"
wininet.dll
"
, setlasterror
=
true
, charset
=
charset.auto)]
public
static
extern
intptr findfirsturlcacheentry([marshalas(unmanagedtype.lptstr)]
string
urlsearchpattern, intptr lpfirstcacheentryinfo,
ref
int
lpdwfirstcacheentryinfobuffersize);
[dllimport(
"
wininet.dll
"
, setlasterror
=
true
, charset
=
charset.auto)]
public
static
extern
bool
geturlcacheentryinfo( [marshalas(unmanagedtype.lptstr)]
string
lpszurlname, intptr lpcacheentryinfo,
ref
int
lpdwcacheentryinfobuffersize );
public
static
string
getcatchfilename(
string
url)
...
{
int
nneeded
=
0
, nbufsize;
intptr buf;
findfirsturlcacheentry(
null
, intptr.zero,
ref
nneeded );
nbufsize
=
nneeded; buf
=
marshal.allochglobal( nbufsize );
geturlcacheentryinfo(url,buf,
ref
nneeded);
internet_cache_entry_info cacheitem;
geturlcacheentryinfo(url,buf,
ref
nneeded);
cacheitem
=
(internet_cache_entry_info) marshal.ptrtostructure( buf,
typeof
(internet_cache_entry_info) );
string
res
=
marshal.ptrtostringauto(cacheitem.lpszlocalfilename);
return
(res);
}
查看全文
相关阅读:
JavaScript函数
JavaScript数组知识点
面向对象之继承及属性查找顺序
面向对象二
面向对象
正则表达式补充
垃圾回收机制、标记删除及分代回收
hashlib、hmac、subprocess、configparser模块
模块、起别名、from导入
递归、匿名函数、内置函数
原文地址:https://www.cnblogs.com/cl1024cl/p/6204972.html
最新文章
算法提高 第二大整数
蓝桥杯- 算法提高 逆序排列
vijos1906:联合权值
POJ1061(线性同余方程)
HDU1021(模运算)
POJ1159:动态规划
CodeForces 620E:New Year Tree(dfs序+线段树)
HDU5692(dfs序+线段树)
POJ3321(dfs序列+树状数组)
HDU3887(树dfs序列+树状数组)
热门文章
HDU4039(map应用)
POJ1020(小正方形铺大正方形)
查缺补漏
js图片轮播与索引变色
JavaScript表单验证
浅尝JavaScript document对象
小试牛刀JavaScript鼠标事件
JavaScript对象(window)
浅谈JavaScript递归
JavaScript用二分法查找数据等
Copyright © 2011-2022 走看看