资源说明:自动浏览器v2
较前一版本实现了分组功能。
本自动浏览器的功能: 单次或循环访问批量网页
可以手动修改文件autobrowser\bin\Debug\urls.xml来修改网址。
1 //组名
nathen //链接名
http://hi.baidu.com/nathen //网站地址
a
a
http://126.com
a
a
http://163.com
去除组合框的相同值
使用一个函数进行处理
private bool combomunique(ComboBox cmb)
{
int cmbno=cmb.Items .Count ;
string [] cmbtemp=new string[cmbno ];
for (int i = 0; i < cmb.Items.Count; i++)
{
cmbtemp[i] = cmb.Items[i].ToString();
}
cmb.Items.Clear();
bool find=false ;
for (int i = 0; i < cmbno; i++)
{
find = false;
for (int j = 0; j < i; j++)
{
if (cmbtemp [j] == cmbtemp [i])
{
find = true;
break;
}
}
if (find ==false)
{
cmb .Items .Add (cmbtemp[i]);
}
}
return true;
}
使用举例:
try
{
ds.ReadXml("urls.xml");
}
catch
{
xmlcreate();
ds.ReadXml("urls.xml");
}
//填充分类组合框
urltotal = ds.Tables[0].Rows.Count; //填充地址框列表
for (int i = 0; i < ds.Tables[0].Rows.Count; i++) //加载全部链接
{
cbgroup.Items.Add(ds.Tables[0].Rows[i]["ug"].ToString());
}
combomunique(cbgroup);
本源码包内暂不包含可直接显示的源代码文件,请下载源码包。
English
