textarea dir="ltr" tabindex="-1" role="textbox" aria-label="Rich text editor, vB_Editor_001_editor, press ALT 0 for help." class="cke_source cke_enable_context_menu" style="width: 100%; height: 100%; min-width: 100%; max-width: 100%; resize: none; outline: none; text-align: left;
这是textarea。我想在那里发送价值但是。没有名字或身份证明。我无法发送价值。
答案 0 :(得分:1)
使用WebBrowser HtmlDocument GetElementsByTagName函数
var elements = WebBrowser1.Document.GetElementsByTagName("textarea");
foreach (HtmlElement element in elements)
{
if (element.InnerHTML.Contains("Rich text editor"))
{
// do something
}
}
答案 1 :(得分:0)
是否可以简单地设置id,然后给它一个 runat =“server”属性,或者是阻止你这样做的东西?
<强>标记:强>
<textarea id="myTextArea" runat="server" tabindex="-1" role="textbox"
aria-label="Rich text editor, vB_Editor_001_editor, press ALT 0 for help."
class="cke_source cke_enable_context_menu"
style="width: 100%; height: 100%; min-width: 100%; max-width: 100%; resize: none; outline: none; text-align: left;">
C#代码:
myTextArea.Value = "This is the inner value";
答案 2 :(得分:0)
const string textUWantToInput = "Inputed text";
var input = webBrowser1.Document.GetElementsByTagName("textarea");
input[0].SetAttribute("value", textUWantToInput);