我一直在研究如何使用 StreamWriter 创建一个新的 html 文件并将其保存在服务器端。我对 javascript 相当了解,而对 PHP 了解较少。我已阅读此处发布的示例:
http://social.msdn.microsoft.com/forums/en-US/winforms/thread/5a13f536-b3ac-4f9f-ac8f-70ee1909d04d
if (!File.Exists("Test.htm"))
{
StreamWriter stream = new StreamWriter("Test.htm", true, System.Text.Encoding.UTF8);
stream.Write(@"<html>" + stream.NewLine+@"<body>" +stream.NewLine);
stream.Write(@"<table width='100%' cellpadding='10' style='margin-top:10px'
cellspacing='3' border='1' rules='all'>
<tr>
<td>
<h3>
<span style='font-family:Verdana'> My Test Is here</span></h3>
</td>
</tr>
</table>" + stream.NewLine +"</body>" + stream.NewLine +"</html>");
stream.Flush();
stream.Close();
}
.
谁能告诉我这段代码在哪里?这是外部脚本吗?是否需要在服务器端安装任何东西才能使 StreamWriter 工作?