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);
}
查看全文
相关阅读:
算法洗脑系列(8篇)——第五篇 分治思想
算法洗脑系列(8篇)——第七篇 动态规划
算法洗脑系列(8篇)——第四篇 枚举思想
8天学通MongoDB——第二天 细说增删查改
12篇学通C#网络编程——第一篇 基础之进程线程
算法系列15天速成——第十五天 图【下】(大结局)
算法洗脑系列(8篇)——第一篇 递推思想
8天学通MongoDB——第三天 细说高级操作
8天学通MongoDB——第四天 索引操作
算法洗脑系列(8篇)——第八篇 概率思想
原文地址:https://www.cnblogs.com/cl1024cl/p/6204972.html
最新文章
只允许指定IP远程桌面连接_使用IP安全策略
细数开源历史上的九个重大事件
C#实现简单WEB服务器
把ASP应用中的Session传递给asp.net应用
如何在C#中使用Win32 API和其他库
SQL Server索引的维护 索引碎片、填充因子 <第三篇>
SQL Server索引设计 <第五篇>
SQL Server 视图
Linq to object 技巧、用法集锦
golang 基础编程
热门文章
2021 年6月面试遭遇滑铁卢,现在这么内卷了吗
GPU服务器与CPU服务器的区别,如何选择GPU服务器
深入理解PHP的GC(Garbage collection)问题
Redis 持久化是如何做的? RDB和AOF对比分析
python 图片图像转化视频
git 常用命令大全
GPU服务器的用处是什么?跟普通服务器有什么区别?
网络编程TCP三次握手
一文详解scp命令
算法洗脑系列(8篇)——第二篇 递归思想
Copyright © 2011-2022 走看看