如何在Windows窗体中打开网页....? [英] how to open a web page in my windows form.......?

查看:84
本文介绍了如何在Windows窗体中打开网页....?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

private void Open_Click(object sender, EventArgs e)
        {
            openFileDialog1.ShowDialog();
            string filename = openFileDialog1.FileName;
            if (File.Exists(filename) == true)
            {
                StreamReader sr = new StreamReader(filename);
                txt_lesson.Text = sr.ReadToEnd();
                sr.Read();

            }

}




我需要以Windows窗体打开.htm文件....
如果我在文本框中使用tiz代码打开,则它将仅显示页面源(html标记).....

我需要作为网页打开




i need to open a .htm file in my windows form.......
if i open with tiz code in textbox means it will display only the page source (html tags) only.....

i need to open as a web page

推荐答案

您将需要某种webbrowser控件来呈现html.

一些选项是:
Webkit: http://sourceforge.net/projects/webkitdotnet/?_test=b [ ^ ]
GeckoFX: http://code.google.com/p/geckofx/ [ http://msdn.microsoft.com/en-us/library/2te2y1x6.aspx [^ ]

祝你好运!
You would need somekind of webbrowser control to render the html.

Some options are:
Webkit: http://sourceforge.net/projects/webkitdotnet/?_test=b[^]
GeckoFX: http://code.google.com/p/geckofx/[^]
IE: http://msdn.microsoft.com/en-us/library/2te2y1x6.aspx[^]

Good luck!


您在工具箱/通用控件中拥有WebBrowser控件.
只需将其放在表单上并使用以下命令显示html文件即可:

webBrowser1.Navigate(filename);
You have WebBrowser control in Toolbox/Common Controls.
Just put it on your form and display html file using:

webBrowser1.Navigate(filename);


在此控件的帮助下使用webbrowser控件,您可以
打开.html文件
use webbrowser control with the help of this control you can
open .html file


这篇关于如何在Windows窗体中打开网页....?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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