-
c# 扫描IP Http Header
c# 扫描IP Http Headerusing System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;using System.Threading;using System.IO;namespace HScan{ public partial class Form1 : Form { int _currentThreads = 0; int _maxThreads = 100; Thread main = null; Thread mt = null; List threads = new List(); public Form1() { InitializeComponent(); Control.CheckForIllegalCrossThreadCalls = false; } private void btnStart_Click(object sender, EventArgs e) { btnStart.Enabled = false; if (txtStart.Text.Trim() == "") { MessageBox.Show("起始IP不能为空."); return; } if (txtEnd.Text.Trim() == "") { MessageBox.Show("结束IP不能为空."); return; } int ts = Convert.ToInt32(txtThreads.Text); _maxThreads = ts; string startIp = txtStart.Text; string endIp = txtEnd.Text; TParameter tp=new TParameter(); tp.StartIp=startIp; tp.EndIp=endIp; tp.ThreadCount=ts; main = new Thread(new ParameterizedThreadStart(StartMe)); main.Start(tp); } protected void ThreadManage() { Thread c=null; while (true) { System.Object lockThis = new System.Object(); lock (lockThis) { for (int i = 0; i < threads.Count; i ) { if (threads[i] != null && !threads[i].IsAlive) { c = threads[i]; break; } } if (c != null) { threads.Remove(c); } } } } protected void StartMe(object ob) { mt = new Thread(new ThreadStart(ThreadManage)); mt.Start(); TParameter p = ob as TParameter; string curIp = p.StartIp; while (true) { for (int i = 0; i < _maxThreads; i ) { if (curIp != "") { if (_currentThreads >= _maxThreads) break; System.Object lockThis = new System.Object(); lock (lockThis) { _currentThreads ; if (_currentThreads > _maxThreads) _currentThreads = _maxThreads; string tip = curIp; Thread t = new Thread(new ParameterizedThreadStart(Run)); t.Start(tip); threads.Add(t); curIp = IPUtility.getLastIp(curIp, p.EndIp, 1); } } else { break; } } } } protected void Run(object ob) { string ip = ob.ToString(); SocketGetHead h = new SocketGetHead(); string ret = h.GetHtml(ip, 80); if (ret.IndexOf("DVRDVS-Webs") > 0) { ListViewItem item = new ListViewItem(); item.SubItems[0].Text = (listView1.Items.Count 1).ToString(); ListViewItem.ListViewSubItem lvSubItem = new ListViewItem.ListViewSubItem(); lvSubItem.Text = ip; item.SubItems.Add(lvSubItem); lvSubItem = new ListViewItem.ListViewSubItem(); lvSubItem.Text = "DVRDVS-Webs"; item.SubItems.Add(lvSubItem); listView1.Items.Add(item); } System.Object lockThis = new System.Object(); lock(lockThis) { lblCurIp.Text = ip; _currentThreads--; if (_currentThreads < 0) _currentThreads = 0; } } private void tsmCopy_Click(object sender, EventArgs e) { if (listView1.SelectedItems.Count > 0) { string ip = listView1.SelectedItems[0].SubItems[1].Text; Clipboard.SetText(ip); } } private void tsmExport_Click(object sender, EventArgs e) { StreamWriter writer = new StreamWriter(AppDomain.CurrentDomain.BaseDirectory "\export.txt",true); foreach (ListViewItem item in listView1.Items) { string ip=item.SubItems[1].Text; writer.WriteLine(ip); writer.Flush(); } writer.Flush(); writer.Close(); MessageBox.Show("导出成功!"); } private void Form1_FormClosing(object sender, FormClosingEventArgs e) { try { if (mt != null) { mt.Interrupt(); mt.Abort(); } foreach (Thread t in threads) { t.Interrupt(); t.Abort(); } if (main != null) { main.Interrupt(); main.Abort(); } } catch { } Thread.Sleep(5000); } private void btnStop_Click(object sender, EventArgs e) { try { if (mt != null) { mt.Interrupt(); mt.Abort(); } foreach (Thread t in threads) { t.Interrupt(); t.Abort(); } if (main != null) { main.Interrupt(); main.Abort(); } } catch { } btnStart.Enabled = true; } }}
- 2014-06-23下载
- 积分:1
-
first
实现固定时隙分配的TDMA算法,有完整的节点和进程模型,用opnet实现(The TDMA algorithm for fixed slot allocation has a complete node and process model, which is implemented by opnet.)
- 2021-02-08 15:09:54下载
- 积分:1
-
xemberwise
CSR蓝牙MP3播放USB DONGLE源码,支持蓝牙A2DP协议,实现无MP3播放功能()
- 2018-07-08 06:01:42下载
- 积分:1
-
live555_vs2008_vs2015(live.2014.07.25)
说明: live555 rtsp build in vs2008 and vs2015.
also make testRTSPClient execute project
- 2020-06-19 19:00:01下载
- 积分:1
-
tf-idf一种计算方法
tf-idf一种计算方法
- 2014-07-02下载
- 积分:1
-
FluentUDF
用于Fluent 对采空区气体运移的模拟(Simulation of Gas Migration in Goaf by Fluent)
- 2020-12-15 10:19:13下载
- 积分:1
-
局域网内聊天传输文件
局域网内聊天传输文件.rar 1、可以进行群聊。 2、点中名字前的复选框要以说消消话。 3、可以群发文件,可以发给指定的人(选中复选框),也可以发给所有人。(LAN chatting to transfer files. Rar one can communicate with a group. 2, points name before the check box to say Consumers Consumers then. 3, the mass document can be sent to the designated person (selected check box), also be given to all.)
- 2005-07-01 19:25:21下载
- 积分:1
-
01liaotianshi
第1章实例01-简单网络聊天室.zip(Chapter 1 Examples 01- Simple network chat rooms. Zip)
- 2013-05-31 09:23:05下载
- 积分:1
-
c# 高性能 iocp服务端 示例源码
c# 高性能 iocp服务端 示例源码
- 2017-12-28下载
- 积分:1
-
socket
vc++ 下的socket收发例程,tcp和udp例程(socket vc++)
- 2013-11-03 23:06:48下载
- 积分:1