将HTML或txt文件转换为ASP输出的vbs代码
时间:2020-10-13 10:07:09|栏目:VBS|点击: 次
使用方法:手工修改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代码
栏 目:VBS
下一篇:vbs 百度小助手
本文标题:将HTML或txt文件转换为ASP输出的vbs代码
本文地址:http://www.codeinn.net/misctech/10632.html