這是我的監控HTTP代碼:HTTP監視器在C#
static void Main(string[] args)
{
try
{
byte[] input = BitConverter.GetBytes(1);
byte[] buffer = new byte[4096];
Socket s = new Socket(AddressFamily.InterNetwork, SocketType.Raw, ProtocolType.IP);
s.Bind(new IPEndPoint(IPAddress.Parse("127.0.0.1"), 80));
s.IOControl(IOControlCode.ReceiveAll, input, null);
s.BeginReceive(arrResponseBytes, 0, arrResponseBytes.Length, SocketFlags.None, new AsyncCallback(OnClientReceive), s);
System.Threading.ManualResetEvent reset = new System.Threading.ManualResetEvent(false);
reset.WaitOne();
}
catch (Exception ex)
{
Console.WriteLine(ex);
}
Console.ReadKey();
}
static byte[] arrResponseBytes = new byte[1024 * 5];
protected static void OnClientReceive(IAsyncResult ar)
{
Socket socket = (Socket)ar.AsyncState;
int count = socket.EndReceive(ar);
if (count > 0)
{
Console.WriteLine(Encoding.ASCII.GetString(arrResponseBytes, 0, count));
socket.BeginReceive(arrResponseBytes, 0, arrResponseBytes.Length, SocketFlags.None, new AsyncCallback(OnClientReceive), socket);
}
}
,但我不能讓HTTP主機。 我不知道什麼數據。 我想獲取http主機,例如: http://google.com 我該如何監控系統http? 謝謝。
這是我的數據是:http://hamishebaharp30world.persiangig.com/Pics/Use/http%20monitoring .jpg – 2012-07-09 09:29:17
你試過解壓嗎?可以在服務器端進行壓縮(通過頭文件告知),然後你會看到垃圾。無論如何,我不確定您是否可以區分不同的請求,但正如我所說,我不確定這是否會成爲問題。 – Sascha 2012-07-09 09:57:43
你是如何擺弄軟件的?我想讓瀏覽器成爲事實。 – 2012-07-09 10:42:10