陈一凡666 2019-05-28 14:56 采纳率: 0%
浏览 347

WPF中使用GetElementById,显示“object”未包含“getElementById”的定义

private void goNavigateButton_Click(object sender, RoutedEventArgs e)
{
// Get URI to navigate to

Uri uri = new Uri(this.addressTextBox.Text, UriKind.RelativeOrAbsolute);

        // Only absolute URIs can be navigated to  
        if (!uri.IsAbsoluteUri)
        {
            MessageBox.Show("The Address URI must be absolute eg 'http://www.microsoft.com'");
            return;
        }

        // Navigate to the desired URL by calling the .Navigate method  
        WebBrowser1.Navigate(uri);

            string s = WebBrowser1.Document.getElementById("txt1").Value;


    }
  • 写回答

1条回答 默认 最新

  • threenewbee 2019-05-30 11:04
    关注

    dynamic doc = WebBrowser1.Document;
    string s = doc.getElementById("txt1").Value;

    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器