【发布时间】:2015-03-06 08:11:27
【问题描述】:
如何最有效地将 HTML iframe 嵌入到我的 c# 应用程序中。
让我们说这个 youtube 视频:
<iframe width="560" height="315" src="//www.youtube.com/embed/UJ53Js0YKZM" frameborder="0" allowfullscreen></iframe>
我试过这个但没有用:
Private Sub InitializeComponent()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmAbout))
'
'frmVirtual
'
Me.Text = "Virtual"
Me.VirtualView = New WebBrowser
Me.VirtualView.Navigate("<iframe src='https://www.google.com/maps/embed?pb=!1m0!3m2!1sen!2sau!4v1481252003737!6m8!1m7!1sF%3A-pwYGx-oWTIk%2FWC6LeJuIxdI%2FAAAAAAAABIg%2FphppDvMZr54JiWnLbsbUgDcTGUfGXLMRACLIB!2m2!1d-33.76525136331761!2d150.9088391438127!3f310!4f0!5f0.7820865974627469' width='600' height='450' frameborder='0' style='border: 0' allowfullscreen></iframe>")
Me.SuspendLayout()
End Sub
C# 应用程序当然是一个 Windows 窗体应用程序。它不一定是视频,甚至只是一个带有链接的小横幅,当然是在 iframe 中。请帮忙!
【问题讨论】:
-
使用内置的Webbrowser控件显示html