范文 |
因为需要用asp输出一段内容,如果内容过多的话,不断的response.write太累,所以就需要用这断代码,方便用快速的转换,其实只要是文本文件都可以输出的。 使用方法:手工修改html文件的名称与想要生成的asp的文件名称,然后将下面的代码保存为1.vbs,跟1.html放同一个目录双击运行即可。 代码如下: html = "1.html" asp = "1.asp" Set fso = CreateObject("Scripting.FileSystemObject") Set fhtml = fso.OpenTextFile(html, 1) Set fasp = fso.OpenTextFile(asp, 2, true) While fhtml.AtEndOfStream <> true text = fhtml.ReadLine text = "Response.Write "&""""&Replace(text, """", """""")&"""" fasp.WriteLine(text) wend fhtml.close fasp.close set fso = nothing msgbox "success"
|