将HTML或txt文件转换为ASP输出的vbs代码
(编辑:jimmy 日期: 2024/11/15 浏览:3 次 )
使用方法:手工修改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"
复制代码 代码如下:
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"
下一篇:用VBS实现PHP的md5_file函数代码