﻿{"id":639,"date":"2010-06-14T18:19:00","date_gmt":"2010-06-14T10:19:00","guid":{"rendered":"http:\/\/blog.jixin.ntxz.net\/?p=639"},"modified":"2010-07-30T15:38:50","modified_gmt":"2010-07-30T07:38:50","slug":"asp-net%e8%87%aa%e5%8a%a8%e7%94%9f%e6%88%90html","status":"publish","type":"post","link":"http:\/\/www.ntxz.net\/?p=639","title":{"rendered":"ASP.NET\u81ea\u52a8\u751f\u6210HTML"},"content":{"rendered":"<p><span style=\"COLOR: rgb(0,0,255)\">try<\/span><span style=\"COLOR: rgb(0,0,0)\"><br \/><img decoding=\"async\" src=\"http:\/\/images.csdn.net\/syntaxhighlighting\/OutliningIndicators\/ExpandedBlockStart.gif\" align=top><img decoding=\"async\" style=\"http:\/\/blog.cnbytes.net\/DISPLAY: none\" src=\"http:\/\/images.csdn.net\/syntaxhighlighting\/OutliningIndicators\/ContractedBlock.gif\" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"http:\/\/blog.cnbytes.net\/BORDER-RIGHT: rgb(128,128,128) 1px solid; BORDER-TOP: rgb(128,128,128) 1px solid; DISPLAY: none; BORDER-LEFT: rgb(128,128,128) 1px solid; BORDER-BOTTOM: rgb(128,128,128) 1px solid; BACKGROUND-COLOR: rgb(255,255,255)\">&#8230;<\/span><span><span style=\"COLOR: rgb(0,0,0)\">{<br \/><img decoding=\"async\" src=\"http:\/\/images.csdn.net\/syntaxhighlighting\/OutliningIndicators\/InBlock.gif\" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"http:\/\/blog.cnbytes.net\/COLOR: rgb(0,0,255)\">string<\/span><span style=\"COLOR: rgb(0,0,0)\"> path <\/span><span style=\"COLOR: rgb(0,0,0)\">=<\/span><span style=\"COLOR: rgb(0,0,0)\"> HttpContext.Current.Server.MapPath(<\/span><span style=\"COLOR: rgb(0,0,0)\">&#8220;&#8221;<\/span><span style=\"COLOR: rgb(0,0,0)\">); <br \/><img decoding=\"async\" src=\"http:\/\/images.csdn.net\/syntaxhighlighting\/OutliningIndicators\/InBlock.gif\" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"http:\/\/blog.cnbytes.net\/COLOR: rgb(0,0,255)\">string<\/span><span style=\"COLOR: rgb(0,0,0)\"> temp <\/span><span style=\"COLOR: rgb(0,0,0)\">=<\/span><span style=\"COLOR: rgb(0,0,0)\"> HttpContext.Current.Server.MapPath(<\/span><span style=\"COLOR: rgb(0,0,0)\">&#8220;<\/span><span style=\"COLOR: rgb(0,0,0)\">HTMLPage.htm<\/span><span style=\"COLOR: rgb(0,0,0)\">&#8220;<\/span><span style=\"COLOR: rgb(0,0,0)\">);<br \/><img decoding=\"async\" src=\"http:\/\/images.csdn.net\/syntaxhighlighting\/OutliningIndicators\/InBlock.gif\" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br \/><img decoding=\"async\" src=\"http:\/\/images.csdn.net\/syntaxhighlighting\/OutliningIndicators\/InBlock.gif\" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Encoding code <\/span><span style=\"http:\/\/blog.cnbytes.net\/COLOR: rgb(0,0,0)\">=<\/span><span style=\"COLOR: rgb(0,0,0)\"> Encoding.GetEncoding(<\/span><span style=\"COLOR: rgb(0,0,0)\">&#8220;<\/span><span style=\"COLOR: rgb(0,0,0)\">gb2312<\/span><span style=\"COLOR: rgb(0,0,0)\">&#8220;<\/span><span style=\"COLOR: rgb(0,0,0)\">);<br \/><img decoding=\"async\" src=\"http:\/\/images.csdn.net\/syntaxhighlighting\/OutliningIndicators\/InBlock.gif\" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; StreamReader sr <\/span><span style=\"http:\/\/blog.cnbytes.net\/COLOR: rgb(0,0,0)\">=<\/span><span style=\"COLOR: rgb(0,0,0)\"> <\/span><span style=\"COLOR: rgb(0,0,255)\">null<\/span><span style=\"COLOR: rgb(0,0,0)\">;<br \/><img decoding=\"async\" src=\"http:\/\/images.csdn.net\/syntaxhighlighting\/OutliningIndicators\/InBlock.gif\" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; StreamWriter sw <\/span><span style=\"http:\/\/blog.cnbytes.net\/COLOR: rgb(0,0,0)\">=<\/span><span style=\"COLOR: rgb(0,0,0)\"> <\/span><span style=\"COLOR: rgb(0,0,255)\">null<\/span><span style=\"COLOR: rgb(0,0,0)\">;<br \/><img decoding=\"async\" src=\"http:\/\/images.csdn.net\/syntaxhighlighting\/OutliningIndicators\/InBlock.gif\" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"http:\/\/blog.cnbytes.net\/COLOR: rgb(0,0,255)\">string<\/span><span style=\"COLOR: rgb(0,0,0)\"> str <\/span><span style=\"COLOR: rgb(0,0,0)\">=<\/span><span style=\"COLOR: rgb(0,0,0)\"> <\/span><span style=\"COLOR: rgb(0,0,0)\">&#8220;&#8221;<\/span><span style=\"COLOR: rgb(0,0,0)\">;<br \/><img decoding=\"async\" src=\"http:\/\/images.csdn.net\/syntaxhighlighting\/OutliningIndicators\/InBlock.gif\" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sr <\/span><span style=\"http:\/\/blog.cnbytes.net\/COLOR: rgb(0,0,0)\">=<\/span><span style=\"COLOR: rgb(0,0,0)\"> <\/span><span style=\"COLOR: rgb(0,0,255)\">new<\/span><span style=\"COLOR: rgb(0,0,0)\"> StreamReader(temp, code);<br \/><img decoding=\"async\" src=\"http:\/\/images.csdn.net\/syntaxhighlighting\/OutliningIndicators\/InBlock.gif\" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; str <\/span><span style=\"http:\/\/blog.cnbytes.net\/COLOR: rgb(0,0,0)\">=<\/span><span style=\"COLOR: rgb(0,0,0)\"> sr.ReadToEnd();<br \/><img decoding=\"async\" src=\"http:\/\/images.csdn.net\/syntaxhighlighting\/OutliningIndicators\/InBlock.gif\" align=top>&nbsp;&nbsp;&nbsp;<br \/><img decoding=\"async\" src=\"http:\/\/images.csdn.net\/syntaxhighlighting\/OutliningIndicators\/InBlock.gif\" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"http:\/\/blog.cnbytes.net\/COLOR: rgb(0,0,255)\">string<\/span><span style=\"COLOR: rgb(0,0,0)\"> htmlfilename <\/span><span style=\"COLOR: rgb(0,0,0)\">=<\/span><span style=\"COLOR: rgb(0,0,0)\"> DateTime.Now.ToString(<\/span><span style=\"COLOR: rgb(0,0,0)\">&#8220;<\/span><span style=\"COLOR: rgb(0,0,0)\">yyyyMMddHHmmss<\/span><span style=\"COLOR: rgb(0,0,0)\">&#8220;<\/span><span style=\"COLOR: rgb(0,0,0)\">) <\/span><span style=\"COLOR: rgb(0,0,0)\">+<\/span><span style=\"COLOR: rgb(0,0,0)\"> <\/span><span style=\"COLOR: rgb(0,0,0)\">&#8220;<\/span><span style=\"COLOR: rgb(0,0,0)\">.html<\/span><span style=\"COLOR: rgb(0,0,0)\">&#8220;<\/span><span style=\"COLOR: rgb(0,0,0)\">;<br \/><img decoding=\"async\" src=\"http:\/\/images.csdn.net\/syntaxhighlighting\/OutliningIndicators\/InBlock.gif\" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"http:\/\/blog.cnbytes.net\/COLOR: rgb(0,0,255)\">string<\/span><span style=\"COLOR: rgb(0,0,0)\"> strText <\/span><span style=\"COLOR: rgb(0,0,0)\">=<\/span><span style=\"COLOR: rgb(0,0,0)\"> <\/span><span style=\"COLOR: rgb(0,0,0)\">&#8220;<\/span><span style=\"COLOR: rgb(0,0,0)\">\u6d4b\u8bd5test &lt;input type=&#8217;button&#8217; value=&#8217;123123&#8242;&gt;&lt;\/input&gt;<\/span><span style=\"COLOR: rgb(0,0,0)\">&#8220;<\/span><span style=\"COLOR: rgb(0,0,0)\">;&nbsp;&nbsp;&nbsp;<\/span><span style=\"COLOR: rgb(0,128,0)\">\/\/<\/span><span style=\"COLOR: rgb(0,128,0)\">\u8fd9\u6bb5\u6587\u672c\u662f\u6c49\u5b57\u548c\u82f1\u6587\u8fd8\u6709html\u6309\u94ae \u901a\u8fc7\u66ff\u6362[biaoti]\u6210\u4e3a\u65b0\u7684HTML\u5185\u5bb9<\/span><span style=\"COLOR: rgb(0,128,0)\"><br \/><img decoding=\"async\" src=\"http:\/\/images.csdn.net\/syntaxhighlighting\/OutliningIndicators\/InBlock.gif\" align=top><\/span><span style=\"http:\/\/blog.cnbytes.net\/COLOR: rgb(0,0,0)\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; str <\/span><span style=\"COLOR: rgb(0,0,0)\">=<\/span><span style=\"COLOR: rgb(0,0,0)\"> str.Replace(<\/span><span style=\"COLOR: rgb(0,0,0)\">&#8220;<\/span><span style=\"COLOR: rgb(0,0,0)\">[biaoti]<\/span><span style=\"COLOR: rgb(0,0,0)\">&#8220;<\/span><span style=\"COLOR: rgb(0,0,0)\">, strText);<br \/><img decoding=\"async\" src=\"http:\/\/images.csdn.net\/syntaxhighlighting\/OutliningIndicators\/InBlock.gif\" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sw <\/span><span style=\"http:\/\/blog.cnbytes.net\/COLOR: rgb(0,0,0)\">=<\/span><span style=\"COLOR: rgb(0,0,0)\"> <\/span><span style=\"COLOR: rgb(0,0,255)\">new<\/span><span style=\"COLOR: rgb(0,0,0)\"> StreamWriter(path<\/span><span style=\"COLOR: rgb(0,0,0)\">+<\/span><span style=\"COLOR: rgb(0,0,0)\">htmlfilename, <\/span><span style=\"COLOR: rgb(0,0,255)\">false<\/span><span style=\"COLOR: rgb(0,0,0)\">, code);<br \/><img decoding=\"async\" src=\"http:\/\/images.csdn.net\/syntaxhighlighting\/OutliningIndicators\/InBlock.gif\" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sw.Write(str);<br \/><img decoding=\"async\" src=\"http:\/\/images.csdn.net\/syntaxhighlighting\/OutliningIndicators\/InBlock.gif\" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sw.Flush();<br \/><img decoding=\"async\" src=\"http:\/\/images.csdn.net\/syntaxhighlighting\/OutliningIndicators\/ExpandedBlockEnd.gif\" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<\/span><\/span><span style=\"http:\/\/blog.cnbytes.net\/COLOR: rgb(0,0,0)\"><br \/><img decoding=\"async\" src=\"http:\/\/images.csdn.net\/syntaxhighlighting\/OutliningIndicators\/None.gif\" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"http:\/\/blog.cnbytes.net\/COLOR: rgb(0,0,255)\">catch<\/span><span style=\"COLOR: rgb(0,0,0)\"><br \/><img decoding=\"async\" src=\"http:\/\/images.csdn.net\/syntaxhighlighting\/OutliningIndicators\/ExpandedBlockStart.gif\" align=top><img decoding=\"async\" style=\"http:\/\/blog.cnbytes.net\/DISPLAY: none\" src=\"http:\/\/images.csdn.net\/syntaxhighlighting\/OutliningIndicators\/ContractedBlock.gif\" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/span><span style=\"http:\/\/blog.cnbytes.net\/BORDER-RIGHT: rgb(128,128,128) 1px solid; BORDER-TOP: rgb(128,128,128) 1px solid; DISPLAY: none; BORDER-LEFT: rgb(128,128,128) 1px solid; BORDER-BOTTOM: rgb(128,128,128) 1px solid; BACKGROUND-COLOR: rgb(255,255,255)\">&#8230;<\/span><span><span style=\"COLOR: rgb(0,0,0)\">{<br \/><img decoding=\"async\" src=\"http:\/\/images.csdn.net\/syntaxhighlighting\/OutliningIndicators\/InBlock.gif\" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Response.Write(<\/span><span style=\"http:\/\/blog.cnbytes.net\/COLOR: rgb(0,0,0)\">&#8220;<\/span><span style=\"COLOR: rgb(0,0,0)\">\u51fa\u9519<\/span><span style=\"COLOR: rgb(0,0,0)\">&#8220;<\/span><span style=\"COLOR: rgb(0,0,0)\">);<br \/><img decoding=\"async\" src=\"http:\/\/images.csdn.net\/syntaxhighlighting\/OutliningIndicators\/InBlock.gif\" align=top><br \/><img decoding=\"async\" src=\"http:\/\/images.csdn.net\/syntaxhighlighting\/OutliningIndicators\/ExpandedBlockEnd.gif\" align=top>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<\/span><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>try&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#038;#82 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,8],"tags":[],"class_list":["post-639","post","type-post","status-publish","format-standard","hentry","category-1","category-oldblog"],"views":331,"_links":{"self":[{"href":"http:\/\/www.ntxz.net\/index.php?rest_route=\/wp\/v2\/posts\/639","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.ntxz.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.ntxz.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.ntxz.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.ntxz.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=639"}],"version-history":[{"count":1,"href":"http:\/\/www.ntxz.net\/index.php?rest_route=\/wp\/v2\/posts\/639\/revisions"}],"predecessor-version":[{"id":753,"href":"http:\/\/www.ntxz.net\/index.php?rest_route=\/wp\/v2\/posts\/639\/revisions\/753"}],"wp:attachment":[{"href":"http:\/\/www.ntxz.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=639"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.ntxz.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=639"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.ntxz.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=639"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}