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() 提取缓存文件失败");
                }
            }
    

      

  • 相关阅读:
    python剑指网络篇二
    使用sklean进行多分类下的二分类
    virtualenv下使用matplotlib
    谱聚类python实践
    K均值算法-python实现
    python使用hbase
    php运算符
    php常量
    php数据类型
    git,版本控制教程
  • 原文地址:https://www.cnblogs.com/shanlin/p/3620852.html
Copyright © 2011-2022 走看看