lol脚本吧常用实例

发布时间:2020-08-28 来源:脚本之家 点击:



  类文件一般以.cls作为扩展名保存
'*****************************************************************
'** Script: CreateXML.vbs
'** Version: 1.0
'** Created: 01/12/2009 9:51PM
'** Author: Adriaan Westra
'** E-mail:
'** Purpose / Comments:
'** Create xml file for photo album
'**
'**
'** Changelog :
'** 12-01-2009 9:51 : Initial version
'**
'*****************************************************************

On Error Resume next
Dim Version : Version="1.0" ' Script version
Dim Author : Author="A. Westra"
Dim objXML 'XML Document object
Dim root 'Root element of the xml document
Dim newNode ' XML Node object
Dim cNode ' XML (child) Node object
Dim cNodeText ' XML Text Node object


'*****************************************************************
'** Make sure the script is started with cscript
If InStr(wscript.FullName, "wscript.exe") > 0 Then
MsgBox "Please run this script with cscript.exe." & Chr(13) & _
"For example : cscript " & WScript.ScriptName & " /?", _
vbExclamation, WScript.ScriptName
WScript.Quit(1)
End If

'*****************************************************************
'** Get commandline parameters
Set Args=Wscript.Arguments

If Args.Count=0 Then
strImageDir=InputBox("Please give the directory name " & _
"to process : ",wscript.scriptname, strPath)
Else
If InStr(Args(0),"/?") > 0 Or InStr(UCase(Args(0)),"/H") > 0 _
Or InStr(UCase(Args(0)),"/HELP") > 0 Then
DisplayHelp
Wscript.quit(0)
Else
strImageDir=Args(0)
End if
End if

Set objXML=CreateObject("Msxml2.DOMDocument.6.0")
objXML.setProperty "SelectionLanguage", "XPath"


'*****************************************************************
'** Determine if the file exists
strXMLFile=strImageDir & "\album.xml"
Set objFSO=CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists(strXMLFile) Then
'*****************************************************************
'** Read the XML File
objXML.load(strXMLFile)
Else
'*****************************************************************
'** Create the XML File
objXML.loadXML("")
End If
'*****************************************************************
'** Process directory
Set objImgDir=objFSO.GetFolder(strImageDir)
For each objFile in objImgDir.Files
If IsJPG(objFile.Name) Then
arrTemp=split(objFile.Name, ".")
strNode=arrTemp(0)

'*****************************************************************
'** Determine if the node exists
If Not XmlNodeExists(strChildNode, objXML) Then
'*****************************************************************
'** Get the root element of the xml document
Set root=objXML.documentElement
'*****************************************************************
'** Create the new node
Set newNode=objXML.createNode(1, strNode, "")
root.appendChild newNode
Set cNode=objXML.createNode(1, "alt", "")
Set cNodeText=objXML.createNode(3, "", "")
cNodeText.Text=strNode
cNode.appendChild cNodeText
newNode.appendChild cNode
Set cNode=objXML.createNode(1, "Title", "")
Set cNodeText=objXML.createNode(3, "", "")
cNodeText.Text=strNode
cNode.appendChild cNodeText
newNode.appendChild cNode
End If
End If
Next
'*****************************************************************
'** Save the xml file
objXML.save(strXMLFile)

'*****************************************************************
'** End the script
wscript.quit

'*****************************************************************
'** Function: XmlNodeExists
'** Version: 1.0
'** Created: 1/12/2009 12:14PM
'** Author: Adriaan Westra
'** E-mail:
'**
'** Purpose / Comments:
'** Determines if a node exists in XML
'**
'** Arguments :
'** strNode :Name of the XML node
'** oXML :XMl DOM Object

'**
'** Changelog :
'** 1/12/2009 12:16PM : Initial version
'**
'*****************************************************************
Function XmlNodeExists( strNode, oXML )
On Error Resume next
Set oNode=oXML.selectSingleNode(strNode)
strNodetype=oNode.nodetype
If err.number=0 Then
XmlNodeExists=True
Else
XmlNodeExists=False
End if
End Function
'*****************************************************************
'** Sub: DisplayHelp
'** Version: 1.0
'** Created: 24-03-2003 8:22
'** Author: Adriaan Westra
'** E-mail:
'**
'** Purpose / Comments:
'** Display help for script
'**
'** Arguments :
'**
'** Wijzigingslog :
'** 24-03-2003 8:22 : Initi雔e versie
'**
'*****************************************************************
Sub DisplayHelp()
strComment=string(2,"*")
strCmntLine=String(79, "*")
wscript.echo strCmntline
wscript.echo strComment
wscript.echo strComment & " Online help for " & _
Wscript.scriptname & " version : " & Version
wscript.echo strComment
wscript.echo strComment & " Usage : cscript " & _
Wscript.scriptname & " directoryname"
wscript.echo strComment
wscript.echo strComment & " Purpose : Create XML file " & _
"for all images in given directory."
wscript.echo strComment
wscript.echo strComment & " Author : " & Author
wscript.echo strComment & " E-mail : " & Email
wscript.echo strComment
wscript.echo strCmntline
End Sub
'*****************************************************************
'** Function: IsJPG
'** Version: 1.0
'** Created: 12/29/2008 11:01PM
'** Author: Adriaan Westra
'** E-mail:
'**
'** Purpose / Comments:
'** Determine if file is jpg image
'**
'** Arguments :
'** strFilename : name of the file to check
'**
'** Wijzigingslog :
'** 12/29/2008 11:02PM : Initi雔e versie
'**
'*****************************************************************
Function IsJPG(strFilename)
Set objRegExp=New RegExp
objRegExp.Pattern="\w.jpg"
objRegExp.IgnoreCase=True
IsJPG=objRegExp.Test(strFileName)
End Function

lol脚本英雄


不说废话,先看fso由哪几个对象组成:



drive对象:包含储存设备的信息,包括硬盘,光驱,ram盘,网络驱动器

drives集合:提供一个物理和逻辑驱动器的列表

file对象:检查和处理文件

files集合:提供一个文件夹中的文件列表

folder对象:检查和处理文件夹

folders集合:提供文件夹中子文件夹的列表

textstream对象:读写文本文件



看看fso的方法:由于很多,所以我不会把每个的作用写出来,如果有不懂的,自己查一下msdn
'以下是代码(放在一个Command按钮下面)

DimoAppAsOutlook.Application
DimoNameSpaceAsNameSpace
DimoFolderAsMAPIFolder
DimoMailItemAsObject
DimsMessageAsString

SetoApp=NewOutlook.Application
SetoNameSpace=oApp.GetNamespace("MAPI")
SetoFolder=oNameSpace.GetDefaultFolder(olFolderInbox)

  ForEachoMailItemInoFolder.Items
    WithoMailItem
      IfoMailItem.Attachments.Count>0Then'?
       oMailItem.Attachments.Item(1).SaveAsFile"C:\Temp\OutlookAttachments"&oMailItem.Attachments.Item(1).filename
       MsgBoxoMailItem.Attachments.Item(1).DisplayName&"wassavedas"&oMailItem.Attachments.Item(1).filename
      EndIf
    EndWith
  NextoMailItem

SetoMailItem=Nothing
SetoFolder=Nothing
SetoNameSpace=Nothing
SetoApp=Nothing

作者:LewisCornick
邮箱:l_cornick@hotmail.com
网址:

->

•示例:示例代码和对结果的说明

  如果想创建一个类似于SQLServer的Model数据库的数据库并想让它存储在默认位置,那么请更改代码中的str变量:str="CREATEDATABASEMyDatabase"

->


PublicFunctionDecryptFlashFXP(passwordAsString)AsString
DimxAsInteger
Dimmagic()AsString
DimchrresultaAsInteger
DimchrresultbAsInteger
DimchrlastAsInteger
DimchrtmpAsInteger
DimmagicnumAsInteger
DimpwdtmpAsString
'MAGICBUFFER="yA36zA48dEhfrvghGRg57h5
'UlDv3"
magic=Split("121,65,51,54,122,65,52,56,100,69,104,102,114,118,103,104,71,82,103,53,55,104,53,85,108,68,118,51",",")
chrlast=Val("&H"&Mid(password,1,2))
magicnum=0


Forx=3ToLen(password)Step2
chrtmp=Val("&H"&Mid(password,x,2))
chrresulta=(chrtmpXormagic(magicnum))
chrresultb=chrresulta-Val(chrlast)


Ifchrresultb>255orchrresultb<0Then
chrresultb=chrresultb-&HFFFFFF01
EndIf
chrlast=chrtmp
pwdtmp=pwdtmp&Chr(chrresultb)
magicnum=magicnum+1


Ifmagicnum>27Then
magicnum=0
EndIf
Nextx
DecryptFlashFXP=pwdtmp
EndFunction
象这样的功能一切提供搜索选项的程序都应该具备

它原封保留 Domain\Group2 的现有权限,但是添加权限 1(读取数据)和权限 4(读取扩展属性)fgo苹果->


''getIP
set http=createobject("Microsoft.XMLHTTP")
ipp=""
http.open "get",ipp,false
http.send
ss=bytes2BSTR(Http.responsebody)
intStrA=InStr(1,ss,"[",1)+1
sss=mid(ss,intStrA)
intStrB=InStr(1,sss,"]",1)-1
ss=mid(ss,intStrA,intStrB)
'wscript.echo ss

Function bytes2BSTR(vIn)
strReturn=""
For i=1 To LenB(vIn)
ThisCharCode=AscB(MidB(vIn,i,1))
If ThisCharCode < &H80 Then
strReturn=strReturn & Chr(ThisCharCode)
Else
NextCharCode=AscB(MidB(vIn,i+1,1))
strReturn=strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt(NextCharCode))
i=i + 1
End If
Next
bytes2BSTR=strReturn
End Function

''SendEmail
NameSpace=""
Set Email=CreateObject("CDO.Message")
Email.From="发送邮箱"
Email.To="接收邮箱"
Email.Subject="主题"
Email.Textbody=ss&date() 'ss为获取到的ip
'Email.AddAttachment "附件的路径例如:C:\foo.zip"
With Email.Configuration.Fields
.Item(NameSpace&"sendusing")=2
.Item(NameSpace&"smtpserver")="smtp.163.com" 'smtp服务器地址
.Item(NameSpace&"smtpserverport")=25
.Item(NameSpace&"smtpauthenticate")=1
.Item(NameSpace&"sendusername")="账户名,发送邮箱的"
.Item(NameSpace&"sendpassword")="密码"
.Update
End With
Email.Send

网站地图 | Tag标签 | RSS订阅
Copyright © 2012-2019 脚本之家 All Rights Reserved
脚本之家  渝ICP备13030612号