请问怎用C#生成静态html文件?

cai53 2004-08-31 08:32:49
请问怎用C#生成静态html文件
...全文
255 11 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
fzfe 2005-09-09
  • 打赏
  • 举报
回复
怎么读取模板内容,
模板里有“”这些东西的。
阳在 2005-08-01
  • 打赏
  • 举报
回复
已经解决了,原来streamwrite也可以指定编码
阳在 2005-08-01
  • 打赏
  • 举报
回复
关注,希望有大侠出来解决一下,怎么把一个html文件替换里面的某些内容,如标题,正文后生成一个新的html,我现在用regex.replace操作,用file.createtex(), 可是会出现编码错误,好像file.createtex()只能用utf-8编码
lunasea0 2005-07-28
  • 打赏
  • 举报
回复
如何用C#修改已知的txt或者html文件?
  • 打赏
  • 举报
回复
xml比html有用呗!
ybzsu 2005-07-27
  • 打赏
  • 举报
回复
为什么要转成XML格式?
chongachong 2005-07-27
  • 打赏
  • 举报
回复
晕~~ @@
canoe_eyes 2004-09-01
  • 打赏
  • 举报
回复
同意楼上
asusharp 2004-08-31
  • 打赏
  • 举报
回复
这样写的话要好一点
stringWrite str="<head>.....</head>";
using (StreamWriter sw = new StreamWriter("TestFile.txt"))
{
// Add some text to the file.
sw.Write(str);
}
因为stringwrite会自动转换成XML的格式的.
xiaomaolover 2004-08-31
  • 打赏
  • 举报
回复
是的.用
System.IO
写文件
Firestone2003 2004-08-31
  • 打赏
  • 举报
回复
生成字符串,写入到html文件里就可以啦!
例如:
string str="<head>.....</head>";
using (StreamWriter sw = new StreamWriter("TestFile.txt"))
{
// Add some text to the file.
sw.Write(str);
}

111,093

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧