zoukankan      html  css  js  c++  java
  • Log Sessions to Local Database

    1. Add Rules to Fiddler to create a new menu item as follows:

      // Log the currently selected sessions in the list to a database.
      // Note: The DB must already exist and you must have permissions to write to it.
      public static ToolsAction("Log Selected Sessions") 
      function DoLogSessions(oSessions: Fiddler.Session[]){
      if (null == oSessions || oSessions.Length < 1){
        MessageBox.Show("Please select some sessions first!");
        return;
      }
      var strMDB = "C:\log.mdb";
      var cnn = null;
      var sdr = null;
      var cmd = null;
      try
      {
        cnn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + strMDB);
        cnn.Open();
        cmd = new OleDbCommand();
        cmd.Connection = cnn;
      
        for (var x = 0; x < oSessions.Length; x++){
          var strSQL = "INSERT into tblSessions ([ResponseCode],[URL]) Values (" + 
          oSessions[x].responseCode + ", '" + oSessions[x].url + "')";
          cmd.CommandText = strSQL;
          cmd.ExecuteNonQuery();
        }
      }
      catch (ex){
        MessageBox.Show(ex);
      }
      finally
      {
        if (cnn != null ){
          cnn.Close();
        }
      }
      }
    2. List the new import at the top of your rules script as follows:

      import System.Data.OleDb;
    • Note: This example relies upon OLEDB 4.0 which is not available for 64bit processes. Either:

  • 相关阅读:
    pycharm初始配置
    个人Python笔记
    Linux硬盘分区
    Linux基础(三)
    Linux基础(二)
    linux基础之基本命令
    计算机网络基础
    计算机操作系统
    计算机基础
    vim编辑器
  • 原文地址:https://www.cnblogs.com/hushaojun/p/6945467.html
Copyright © 2011-2022 走看看