国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > VBScript > 正文

VBS加密解密源碼(UserAccounts.CommonDialog) 腳本之家修正版

2020-06-26 18:27:02
字體:
來源:轉載
供稿:網友
有時候自己寫了VBS又怕共享后別人盜用你的源碼呢?這里提供了VBS程序源碼加密的方法。
 
用法: 

1.copy下面代碼至文本文檔 
2.將文件后綴名改為.vbs 
3.雙擊運行 
復制代碼代碼如下:

Ans = InPutBox("請輸入要執行的操作:1.加密,2.解密,3.退出。") 
Ans = Int(Ans) 
If Ans =1 Then 
set fso=createobject("scripting.filesystemobject") 
Set objDialog = CreateObject("UserAccounts.CommonDialog") 
objDialog.Filter = "vbs File|*.vbs|All Files|*.*" 
objDialog.InitialDir = "" 
objDialog.ShowOpen 
strLoadFile = objDialog.FileName 
if not strLoadFile = "" then 
set op=fso.opentextfile(strLoadFile) 
dow=13 
do while op.atendofstream=false 
line=op.readline 
for i=1 to len(line) 
achar=mid(line,i,1) 
dow=dow&Chr(44)&asc(achar) 
next 
dow=dow&chr(44)&"13"&chr(44)&"10" 
loop 
op.close 
set op=fso.opentextfile(strLoadFile,2) 
op.write "strs=array("&dow&")"&chr(13)&chr(10)&_ 
"for i=1 to UBound(strs)"&chr(13)&chr(10)&_ 
" runner=runner&chr(strs(i))"&chr(13)&chr(10)&_ 
"next"&chr(13)&chr(10)&_ 
"Execute runner" 
msgbox "加密成功",,"提示" 
end if 
end if 
If Ans = 2 Then 
Set objfs=CreateObject("scripting.filesystemobject") 
Set objDialog=CreateObject("UserAccounts.CommonDialog") 
objDialog.Filter="vbs File|*.vbs|All Files|*.*" 
objDialog.InitialDir = "" 
objDialog.ShowOpen 
strLoadFile = objDialog.FileName 
if not strLoadFile = "" then 
set objf=objfs.opentextfile(strLoadFile) 
str=objf.ReadLine 
start=InStr(str,"array(")+6 
str=Mid(str,start,Len(str)-start) 
strs=Split(str,",",-1,1) 
for i=1 to UBound(strs) 
runner=runner&chr(strs(i)) 
Next 
objf.Close 
Set objf=objfs.OpenTextFile(strLoadFile,2) 
objf.Write runner 
MsgBox "解密成功",,"提示" 
end if 
end if 
if Ans = 3 Then 
Wscript.Quit 
End If 

注意上面的代碼只有在winxp下使用,因為那個選擇文件功能不能使用而已,下面我們修改下,讓他支持win2000,win2003系統,我們可以通過拖動文件到這個vbs上即可。
腳本之家修改的加強版本
復制代碼代碼如下:

If WScript.Arguments.Count=0 Then WScript.Quit 
strLoadFile=WScript.Arguments(0) 
Ans = InPutBox("請輸入要執行的操作:1.加密,2.解密,3.退出。") 
Ans = Int(Ans) 
If Ans =1 Then 
set fso=createobject("scripting.filesystemobject") 
if not strLoadFile = "" then 
set op=fso.opentextfile(strLoadFile) 
dow=13 
do while op.atendofstream=false 
line=op.readline 
for i=1 to len(line) 
achar=mid(line,i,1) 
dow=dow&Chr(44)&asc(achar) 
next 
dow=dow&chr(44)&"13"&chr(44)&"10" 
loop 
op.close 
set op=fso.opentextfile(strLoadFile,2) 
op.write "strs=array("&dow&")"&chr(13)&chr(10)&_ 
"for i=1 to UBound(strs)"&chr(13)&chr(10)&_ 
" runner=runner&chr(strs(i))"&chr(13)&chr(10)&_ 
"next"&chr(13)&chr(10)&_ 
"Execute runner" 
msgbox "加密成功",,"提示" 
end if 
end if 
If Ans = 2 Then 
Set objfs=CreateObject("scripting.filesystemobject") 
if not strLoadFile = "" then 
set objf=objfs.opentextfile(strLoadFile) 
str=objf.ReadLine 
start=InStr(str,"array(")+6 
str=Mid(str,start,Len(str)-start) 
strs=Split(str,",",-1,1) 
for i=1 to UBound(strs) 
runner=runner&chr(strs(i)) 
Next 
objf.Close 
Set objf=objfs.OpenTextFile(strLoadFile,2) 
objf.Write runner 
MsgBox "解密成功",,"提示" 
end if 
end if 
if Ans = 3 Then 
Wscript.Quit 
End If 

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 横峰县| 乐东| 钦州市| 庆云县| 兴文县| 济阳县| 石楼县| 庐江县| 北辰区| 乌拉特后旗| 从江县| 苏尼特右旗| 盐山县| 桦甸市| 中方县| 腾冲县| 临澧县| 伽师县| 内江市| 化州市| 曲阳县| 顺义区| 大英县| 大石桥市| 镇沅| 林甸县| 云阳县| 昭苏县| 兴和县| 都兰县| 微博| 晋州市| 中西区| 盖州市| 沁水县| 辽源市| 七台河市| 美姑县| 凤城市| 马鞍山市| 惠东县|