日期:2014-05-18 浏览次数:20520 次
string biaoti1 = biaoti.Text.ToString(), neirong2 = neirong.Text.ToString(); string neirong1 = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n\r\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\r\n<head>\r\n<title>测试页</title>\r\n</head>\r\n<body>\r\n" + (neirong2.Replace("\r\n", "<br/>")) + "\r\n</body>\r\n</html>"; string adds = Server.MapPath(".") + "\\html\\" + biaoti1 + ".htm"; StreamWriter f = new StreamWriter(adds); f.Write(neirong1); f.Close(); Response.Write("生成成功;<a target='_blank' href='"+adds+"'>"+adds+"</a>");