-
ex2
旅行商问题
某售货员要到若干城市去推销商品,已知各城市之间的路程(或旅费)。他要选定一条从驻地出发,经过每个城市一遍,最后回到驻地的路线,使总的路程(或旅费)最小。动态归划()
- 2007-08-03 09:04:55下载
- 积分:1
-
432
数据结构的习题和解答,特别希望我能上传上去啊(data structure of the questions and answers, and I especially hope that I can upload up ah )
- 2007-06-02 00:20:48下载
- 积分:1
-
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
-
图像处理程序代码
图像处理课堂程序,对图像进行傅里叶变换,得出频谱图
- 2022-03-16 06:28:39下载
- 积分:1
-
html 编辑器
Html Rednder
fdasfdasfd
sfasd
胎儿酒精紊乱症
f
dasfdsafsdafasdfasdfasdfsdafadsfsdfsd
fasdfdsa
fasdfsdafdsfdsfsdafasdfadsf
- 2023-07-28 17:05:05下载
- 积分:1
-
fileinfo
获取文件信息,包括创建时间,修改时间,访问时间,属性(To obtain file information, including creation time, modification time, access time, properties)
- 2012-06-11 15:36:16下载
- 积分:1
-
yrp.tar
A recursive descent parsing framework powered by C++11 variadic template
- 2014-06-23 16:09:02下载
- 积分:1
-
STM32RS485双机通讯
使用STM32实现上位机与下位机进行RS485通讯
- 2022-02-25 11:20:26下载
- 积分:1
-
11-TFT彩色屏
说明: 基于stm32l476的显示屏例程,接口为SPI,使用最新的HAL库,有cubemx工程文件可供参阅(Based on the display routine of stm32l476, the interface is SPI, using the latest HAL library, there are cubemx engineering files available for reference)
- 2020-06-20 11:00:02下载
- 积分:1
-
Teach-Yourself-DirectX-7-in-24-Hours
Teach Yourself DirectX 7 in 24 Hours E-book
- 2012-09-06 21:14:28下载
- 积分:1