CODE: [Copy to clipboard]
set fs = CreateObject ("Scripting.FileSystemObject")
file123 = ""
if WScript.Arguments.Count=0 then
file123=inputbox("请直接输入当前文件夹下要转化的文件名 FileName.Ext"&chr(13)&chr(10)&"生成 FileName.Ext.htm")
else
file123=WScript.Arguments(0)
end if
html = file123 & ".htm"
ConvertFile file123, html
sub ConvertFile(txt_file, output)
str = Array( chr(132)&chr(228), chr(129)&chr(252), chr(142)&chr(196), chr(153)&chr(214), chr(148)&chr(246), chr(225)&chr(223), "&&", "<<", ">>", vbtab&" ", " " )
if fs.FileExists(txt_file) then
sourcexstr = fs.OpenTextFile(txt_file).readall
with fs.CreateTextFile(output)
.WriteLine "<html><head><style>* {font: 12pt Courier}</style></head><body>"
for each change in str
sourcexstr=replace(sourcexstr, left(change,1), mid(change,2))
next
sourcexstr=replace(sourcexstr, vbcrlf, "<BR>"&vbcrlf)
.write sourcexstr
.WriteLine "</body></html>"
.close
end with
end if
end sub
[CODE: [Copy to clipboard]
set WSHShell = CreateObject("WScript.Shell")
set fs = CreateObject ("Scripting.FileSystemObject")
file123 = ""
if WScript.Arguments.Count=0 then
file123=inputbox("请直接输入当前文件夹下要转化的文件名 FileName.Ext"&chr(13)&chr(10)&"生成 FileName.Ext.htm")
else
file123=WScript.Arguments(0)
end if
html = file123 & ".htm"
ConvertFile file123, html
sub ConvertFile(txt_file, output)
dim str(7)
str(0)=chr(132)&chr(228)
str(1)=chr(129)&chr(252)
str(2)=chr(142)&chr(196)
str(3)=chr(153)&chr(214)
str(4)=chr(148)&chr(246)
str(5)=chr(225)&chr(223)
str(6)="<["
str(7)=">]"
if fs.FileExists(txt_file) then
set source = fs.OpenTextFile(txt_file)
set dest = fs.CreateTextFile(output)
dest.WriteLine "<html><head><style>* {font: 12pt Courier}</style></head><body>"
sourcexstr=source.readall
for each change in str
sourcexstr=replace(sourcexstr,left(change,1),right(change,1))
next
sourcexstr=replace(sourcexstr,chr(13),"<BR>")
dest.write sourcexstr
source.close
dest.WriteLine "</body></html>"
dest.close
end if
end sub
[