Embedding a Web page in a C# Window

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-01 09:46:05

问题


I want to create a simple C# Window which displays the contents of a webpage. Is this possible ?

Eg. (what I am trying to do is)

csharp.window.loadUrl("http://www.google.com")


回答1:


You can simply do this in a WebBrowser control. And use Navigate(string url) method to browse to a website. have a look Here for Details

http://msdn.microsoft.com/en-us/library/3s8ys666.aspx

and here is the details for the WebBrowser Class

http://msdn.microsoft.com/en-us/library/system.windows.forms.webbrowser.aspx




回答2:


I think you want to take a look at the Windows Forms WebBrowser control, or the WPF equivalent




回答3:


Just for completeness, there is also a quite usable control to embed firefox instead of MS Explorer:

GeckoFX




回答4:


Create a form with a WebBrowser control. You can use its methods to navigate to a page or manipulate the document as you see fit.



来源:https://stackoverflow.com/questions/4744184/embedding-a-web-page-in-a-c-sharp-window

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!