Exemple #1
0
        /// <summary>
        /// 创建网络数据包详细信息
        /// </summary>
        /// <param name="Count"></param>
        /// <returns></returns>
        private Run_WebData CreatWebData(int Count)
        {
            Run_WebData Data  = new Run_WebData();
            string      Name  = string.Empty;
            string      Value = string.Empty;

            Data.Url    = plugin.Log.Entries[Count].URL.ToString();
            Data.Method = plugin.Log.Entries[Count].Method.ToString();
            if (Data.Method == "GET")
            {
                for (int i = 0; i < plugin.Log.Entries[Count].Request.QueryStringValues.Count; i++)
                {
                    Name             = plugin.Log.Entries[Count].Request.QueryStringValues[i].Name;
                    Value            = plugin.Log.Entries[Count].Request.QueryStringValues[i].Value;
                    Data.Parameters += Name + "=" + Value + "\r\n";
                }
            }
            else if (Data.Method == "POST")
            {
                for (int i = 0; i < plugin.Log.Entries[Count].Request.POSTParameters.Count; i++)
                {
                    Name             = plugin.Log.Entries[Count].Request.POSTParameters[i].Name;
                    Value            = plugin.Log.Entries[Count].Request.POSTParameters[i].Value;
                    Data.Parameters += Name + "→" + Value + "\r\n";
                }
            }
            for (int i = 0; i < plugin.Log.Entries[Count].Request.Headers.Count; i++)
            {
                Name  = plugin.Log.Entries[Count].Request.Headers[i].Name;
                Value = plugin.Log.Entries[Count].Request.Headers[i].Value;
                if (Name == "Cookie")
                {
                    Data.Cookie = Value;
                }
                if (Name == "Referer")
                {
                    Data.Referer = Value;
                }
                if (Name == "User-Agent")
                {
                    Data.UserAgent = Value;
                }
                Data.Head += Name + ":" + Value + "\r\n";
            }
            return(Data);
        }
Exemple #2
0
 /// <summary>
 /// 事件触发方法
 /// </summary>
 /// <param name="Leixing">类型</param>
 /// <param name="Data">网络数据包</param>
 private void Event(String Leixing, Run_WebData Data)
 {
     if (Page != null)
     {
         if (Leixing == "Count++")
         {
             Page(Leixing, null, Count, KeyCount);
         }
         else if (Leixing == "KeyCount++")
         {
             Page(Leixing, Data, Count, KeyCount);
         }
         else if (Leixing == "Post++")
         {
             Page(Leixing, Data, Count, KeyCount);
         }
         else if (Leixing == "CloseBrowser")
         {
             Page(Leixing, null, 0, 0);
         }
     }
 }