如何在Windows窗体的文本框中打开网页内容........? [英] how to open a web page contents in my text box in my windows form........?
本文介绍了如何在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();
}
如果我放置tiz代码意味着,它将打开该网页的页面源代码,例如html标签........
但我想打开该网页内容
请帮助我,伙计们................
if i place tiz code means , it opens that webpage''s page source code like html tags........
but i want to open that web content
plz help me dudes................
推荐答案
尝试将该文件加载到Web浏览器控件中,而不是普通文本框,您可以使用以下代码将文件加载到Web浏览器控件.
try to load that file in to Web Browser control other than the normal text box, you can use below code to load file to your web browser control.
webBrowser1.Url =new System.Uri("D:\\1.html", System.UriKind.Absolute);
这篇关于如何在Windows窗体的文本框中打开网页内容........?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文