【问题标题】:How to display or embed an <iframe> in vb.net form如何以 vb.net 形式显示或嵌入 <iframe>
【发布时间】:2022-06-30 14:31:32
【问题描述】:

我正在尝试完成这个输出

但结果是这样的

这段代码有什么问题吗?

Dim html As String = "<html><head>"
html &= "<iframe width='1000' height='300' frameborder='0' scrolling='no' marginheight='0' marginwidth='0' src= 'https://maps.google.com/maps?q='" & MainForm.latLng.Text & "'&h1=en&z=19&amp;output=embed'></iframe>"
html &= "</body></html>"
Me.WebBrowser1.DocumentText = String.Format(html)

或者有没有其他方法可以达到我想要的输出,就像上图一样?

【问题讨论】:

  • 您可以尝试将第一行更改为 Dim html As String = "" 尽管从错误看来 Google 正在限制其内容以这种方式显示
  • The Maps Embed API overview 中的示例对您有用吗?
  • @AndrewMorton 是的,这对我有用,谢谢!

标签: vb.net


【解决方案1】:

您没有在代码中添加 URL。难怪为什么它不起作用!

【讨论】:

    猜你喜欢
    • 2014-02-19
    • 1970-01-01
    • 1970-01-01
    • 2019-10-02
    • 1970-01-01
    • 2018-07-22
    • 2012-03-02
    • 2016-10-21
    • 2018-06-22
    相关资源
    最近更新 更多