怎么判断webBrowser控件里加载的页面里checkbox表单默认勾选?<input type="checkbox" name="checkbox" value="0" checked="checked" onclick="switchEditor(this.checked?0:1)" />源码</a>怎么获得这个input的checked的值?
解决方案 »
- 如何控制键盘,只输出小写字母和数字?
- 关于委托
- 请问.net 如何实现这样的功能?
- 大家用VS2003制作安装程序时,公用的dll和ocx都放在哪里?
- 做一个MSI安装文件,能让它在安装时先输入密码吗?有些安装包就是这样的
- 请教高手:C#中如何得到一个自定义类的所有属性及方法?
- 我想数字化扫描到的位图? 主要是其中的曲线.
- 急!wiki程序的Web.config文件debug错误:<location> 路径属性必须为相对虚拟路径。该路径不能以“ ”、“.”、“/”或“\”结尾。
- 关于遍历并同时修改数据库记录的问题 ,高分求救
- 数据库操作时,用数据组件设计时写好参数好,还是在程序动态生成组件并自己写SQL好呀。
- 数字字符串 转成 sql中float 类型数据用啥函数?
- webBrowser submit提交的问题
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;namespace WindowsFormsApplication16
{
public partial class Form1 : Form
{
WebBrowser WB = new WebBrowser();
public Form1()
{
InitializeComponent(); WB.Parent = this;
WB.DocumentText = "<input type='checkbox' name='checkbox' value='0'"
+ "checked='true' onclick='switchEditor(this.checked?0:1)' />源码 </a>";
WB.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(WB_DocumentCompleted);
} void WB_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
{
MessageBox.Show(WB.Document.All.GetElementsByName("checkbox")[0].GetAttribute("checked").ToString());
}
}
}
webBrowser1.Document.All["checkbox"].GetAttribute("checked");