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);
}
查看全文
相关阅读:
linux基础(一)
网络基础之网络协议篇
操作系统简介
计算机组成原理
【C#】=>符号的使用
【Unity3D】用继承EditorUpdater类来实现Editor模式下的后台处理
【Unity3D】Tags和Layers
【Unity3D】Unity3D中Material与ShareMaterial引用的区别
【Unity3D】Unity中用C#读取CSV文件
【Unity3D】用C#读取INI配置文件
原文地址:https://www.cnblogs.com/cl1024cl/p/6204972.html
最新文章
VBS添加Windows登陆账号
Wscript的popup
python3 异常
python3 os模块
python3 文件
python3 函数
python3 基础三
python3 基础二——基本的数据类型二
python3 基础二——基本的数据类型一
php上传文件出现500错误
热门文章
crontab执行定时任务
安装ectouch点击安装按钮无反应
php上传多文件max_file_uploads限制问题
linux-Centos7安装python3并与python2共存
linux-Centos7安装mysql5.7.19
linux基础(六)
linux基础(五)
linux基础(四)
linux基础(三)
linux基础(二)
Copyright © 2011-2022 走看看