各位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隐藏了我就用这招搞的 调用易语言dll有问题!! C#中怎样得到一个字符串的宽度和高度呢?有没有函数阿? C#高手进来帮帮忙 为什么要用接口替代多继承?求解~~~~~ ASP.net中变量的值为何不变的 请问一个解决办法,数据传输 C#在不知道源代码的情况下怎么禁用窗体应用程序的某一个按钮 自定义控件能否拖动变化大小 救救我,作了个控件出错了 求救~!关于socket的Udp通讯问题 菜鸟求助: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隐藏了
我就用这招搞的