[code=vb]
on error resume next
set arg=wscript.arguments
if arg.count=0 then wscript.quit
set fso=CreateObject("Scripting.FileSystemObject")
with fso.opentextfile(arg(0),1,false)
data=.readall:.close
End with
if err.number<>0 then wscript.quit
with fso.opentextfile(arg(0)&".txt",2,true)
if err.number<>0 then wscript.quit
.writeline "data="&Chr(34)&ASCdata(data)&Chr(34)
.writeline "Function ChrData(Data)"
.writeline "MyArray = Split(Data, "","", -1, 1)"
.writeline "For each OldData in MyArray"
.writeline "Newdata=NewData"&Chr(38)&"chr(OldData)"
.writeline "Next"
.writeline "ChrData=NewData"
.writeline "End function"
.writeline "execute Chrdata(data)"
.close
set fso=Nothing
End with
msgbox "ok!"
Function ASCdata(Data)
num=len(data)
newdata=""
For j=1 to num
If j=num then
newdata=newdata&asc(mid(data,j,1))
Else
newdata=newdata&asc(mid(data,j,1))&","
End IF
Next
ASCdata=newdata
End function
[/code]
转载请注明:鸟儿博客 » 很好用的一个vbs加密