ASP.NET写出HTML文件的内容? [英] ASP.NET Write out contents of HTML file?
本文介绍了ASP.NET写出HTML文件的内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我不知道这是否是一个愚蠢的问题,但.. ..
是否有可能在ASP.NET(C#或VB#)中响应。写()另一个HTML文件的内容?如果是这样,怎么样?
解决方案 逐行阅读HTML文件并使用Response.Write()
StreamReader sr = new StreamReader(@C:\abc.html); (sr.Peek()> = 0)
{
line = sr.ReadLine();
Response.Write(line);
}
I don't know if this is a stupid question but..
Is it possible in either ASP.NET (either C# or VB#) to Response.Write() the contents of another HTML file? If so, how?
解决方案
Read the HTML file line by line and write it using Response.Write()
StreamReader sr = new StreamReader(@"C:\abc.html");
while(sr.Peek() >= 0)
{
line=sr.ReadLine();
Response.Write(line);
}
这篇关于ASP.NET写出HTML文件的内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文