zoukankan      html  css  js  c++  java
  • 读取IE缓存文件

    使用WebCacheTool项目中的WinInetAPI.cs和Win32API.cs两个类

           /// <summary>
           /// 获取IE缓存文件
           /// </summary>
           /// <param name="domain">域名</param>
            private void GetFileByIECache(string domain)
            {
                string path = String.Empty;
                try
                {
                    //获取.cfg后缀的文件
                    ArrayList results = WinInetAPI.FindUrlCacheEntries("\.cfg");
                    foreach (WinInetAPI.INTERNET_CACHE_ENTRY_INFO entry in results)
                    {
                        //最后访问时间
                        DateTime accessTime = Convert.ToDateTime(Win32API.ToStringFromFileTime(entry.LastAccessTime));
                        if (entry.lpszSourceUrlName == null) continue;
                        if (!entry.lpszSourceUrlName.Contains(domain))
                        {
                            continue;
                        }
                        //entry.lpszSourceUrlName;
                        path = entry.lpszLocalFileName;
                        /*
                         * 逻辑处理
                         */
    
                        // 删除
                        // WinInetAPI.DeleteFromUrlCache(localPath);
                    }
                }
                catch (Exception ex)
                {
                    TxtLog.InsertLog(ex, "BLL NewsPapers GetNewCFGFile() 提取缓存文件失败");
                }
            }
    

      

  • 相关阅读:
    ArrayBlockingQueue
    mysql数据库引擎
    数据库主从复制,分库分表
    Java并发工具类-Semaphore,Exchanger
    分片策略
    kafka
    关于数据库设计
    生产者消费者模式

    Callable、Future和FutureTask
  • 原文地址:https://www.cnblogs.com/shanlin/p/3620852.html
Copyright © 2011-2022 走看看