各位Winform高手,过来帮个忙吧 我用Winform+webBrowser做了个程序,就是打开网页(网页是未知的),加载网页上所有的select(下拉列表),然后显示在Winform程序上 但是我没有思路 希望大家帮个忙啊! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 IList<string> iurl = new List<string>(); iurl.Add("http://www.cnblogs.com/"); iurl.Add("http://www.tzscn.com/"); iurl.Add("http://www.xinhuanet.com/"); iurl.Add("http://cn.msn.com/"); iurl.Add("http://www.sina.com.cn/"); iurl.Add("http://www.pconline.com.cn/"); iurl.Add("http://blog.csdn.net/"); iurl.Add("http://www.qunar.com/"); iurl.Add("http://www.ftchinese.com/"); iurl.Add("http://cn.wsj.com/gb/"); iurl.Add("http://news.ifeng.com/?_fs"); iurl.Add("http://www.51nb.com/"); iurl.Add("http://www.taobao.com/"); iurl.Add("http://www.csdn.net/"); iurl.Add("http://www.chinaprice.gov.cn/fgw/chinaprice/free/index.htm"); comboBox1.Items.AddRange(iurl.ToArray<string>()); comboBox1.AutoCompleteMode = AutoCompleteMode.SuggestAppend; comboBox1.AutoCompleteSource = AutoCompleteSource.CustomSource; comboBox1.AutoCompleteCustomSource.AddRange(iurl.ToArray<string>()); //窗体加载时添加如下代码,控件为Commbox。 private void comboBox1_SelectedIndexChanged(object sender, EventArgs e) { webBrowser1.Url = new Uri((sender as System.Windows.Forms.ComboBox).Text); }//SelectedIndexChanged事件,选中则导向该页面了。 通过 webBrowser.Document获取网页内容,再遍历所有select 但是不知道 一个页面有多少个select啊 因为页面不一样啊! 人家都说是遍历了你咋还问呢,遍历跟循环的区别还分不清楚?遍历是不需要知道有多少个的,循环是需要知道的笨,其实用循环也行,你要去按照楼主说的研究一下方法就懂了,这个东西我做过,我在给注册QQ的网站上赋值了~他把控件名都JB隐藏了我就用这招搞的 winform调试的问题,断点卡住无效 求助:在win2k在用Win32_DiskDrive获取不到硬盘ID号. 初来"炸"到 打听一下` 如何保持100个线程在工作 .net如何调用Windows API打印? webservice 用户名密码的问题 关于,进程的问题 WPF,关于控件的可视状态,看下这段代码 VS助手类安装好后,怎样用啊? 不太明白ListBox中的Items.Insert() 菜鸟求助:C#向oracle插入date类型数据问题 asp.net,父窗体有一个textbox,子窗体有一个gridview。出现的疑问?
iurl.Add("http://www.cnblogs.com/");
iurl.Add("http://www.tzscn.com/");
iurl.Add("http://www.xinhuanet.com/");
iurl.Add("http://cn.msn.com/");
iurl.Add("http://www.sina.com.cn/");
iurl.Add("http://www.pconline.com.cn/");
iurl.Add("http://blog.csdn.net/");
iurl.Add("http://www.qunar.com/");
iurl.Add("http://www.ftchinese.com/");
iurl.Add("http://cn.wsj.com/gb/");
iurl.Add("http://news.ifeng.com/?_fs");
iurl.Add("http://www.51nb.com/");
iurl.Add("http://www.taobao.com/");
iurl.Add("http://www.csdn.net/");
iurl.Add("http://www.chinaprice.gov.cn/fgw/chinaprice/free/index.htm"); comboBox1.Items.AddRange(iurl.ToArray<string>());
comboBox1.AutoCompleteMode = AutoCompleteMode.SuggestAppend;
comboBox1.AutoCompleteSource = AutoCompleteSource.CustomSource;
comboBox1.AutoCompleteCustomSource.AddRange(iurl.ToArray<string>()); //窗体加载时添加如下代码,控件为Commbox。 private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
webBrowser1.Url = new Uri((sender as System.Windows.Forms.ComboBox).Text);
}//SelectedIndexChanged事件,选中则导向该页面了。
但是不知道 一个页面有多少个select啊 因为页面不一样啊!
他把控件名都JB隐藏了
我就用这招搞的