.NET web浏览器和放大器; textarea的 [英] .NET webbrowser & textarea

查看:156
本文介绍了.NET web浏览器和放大器; textarea的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在VB.NET/C# WebBrowser控件中写入数据。

I want to write data within the Webbrowser control in VB.NET/C# .

本页面code:< textarea的ID =paste_contentNAME =paste_content>< / textarea的>

我到目前为止已经试过: WebBrowser1.Document.GetElementById(paste_content)的setAttribute(值,测试)

I have tried so far : WebBrowser1.Document.GetElementById("paste_content").SetAttribute("Value", "test")

但它不工作...

推荐答案

我写一个例子:(试试这个(在C#))

I write an example:(try this(in C#))

 public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
            webBrowser1.DocumentCompleted += new WebBrowserDocumentCompletedEventHandler(webBrowser1_DocumentCompleted);
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            webBrowser1.DocumentText = "<html><body><textarea id=\"paste_content\" name=\"paste_content\"></textarea></body></html>";
        }

        void webBrowser1_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
        {
            webBrowser1.Document.GetElementById("paste_content").InnerText = "test";
        }
    }

这篇关于.NET web浏览器和放大器; textarea的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆