网页代码是这样的 <select name="DdlTypeId" id="DdlTypeId">
<option value="1">便携式心电</option>
<option value="2">无线血压</option>
<option value="3">无线血氧</option>
<option selected="selected" value="4">无线脂肪</option>
</select>
请问如何获取到选中的值? 就是有“selected”的“无线脂肪”;
<option value="1">便携式心电</option>
<option value="2">无线血压</option>
<option value="3">无线血氧</option>
<option selected="selected" value="4">无线脂肪</option>
</select>
请问如何获取到选中的值? 就是有“selected”的“无线脂肪”;
解决方案 »
- 请问怎样获取XML中的注释节点
- dtatgridview刷新后滚动条复位,怎样解决?
- C#中DLL调用的问题,急求高手帮忙!!!
- 怎么记windows窗体应用程序控件的东西。。。
- 在运行时模式下就可以直接在控件边的八个点来改变大小以及移动控件
- 已经有byte[]的图像数据,何种方式创建Bitmap对象,或者是转换成Hbitmap类型指针速度最快?
- asp.net编程中,在代码与显示分离的前提下,如何动态生成html
- datagrid如何删除一行呀
- 急时求救!!C#中调用WIN32 API时出错,多谢指点
- c# 如何读取网页上的数据 求大神指点
- C#.Net下載FTP服務器上特定目錄下的文檔
- C#控件!
if (webBrowser1.Document.All[i].GetAttribute("value") == "")
{
s= webBrowser1.Document.All[i];
s.SetAttribute("checked", "checked");
}
if (sender is WebBrowser)
{
WebBrowser webbr = (WebBrowser)sender;
HtmlElementCollection btn_Label = webbr.Document.GetElementsByTagName("span"); if (webbr.Name.EndsWith("Equipment"))
{
HtmlElementCollection inputSqltem = webbr.Document.GetElementsByTagName("select");
foreach (HtmlElement eltems in inputSqltem)
{
if (eltems.GetAttribute("ID").ToString().Equals("DdlTypeId"))
{
temss = eltems.GetAttribute("selected").ToString();
break;
}
}
} 但是获取的temss老是空的。没有值啊。是不是写的不对?
heSelct.GetElementsByTagName("option")[selectedIndex].OuterText;