2019快手引流脚本编

发布时间:2020-09-04 来源:脚本之家 点击:

BASModule模块
把以下代码回到BASModule模块:

OptionExplicit
PrivateConstIP_SUCCESSAsLong=0
PrivateConstIP_STATUS_BASEAsLong=11000
PrivateConstIP_BUF_TOO_SMALLAsLong=(11000 1)
PrivateConstIP_DEST_NET_UNREACHABLEAsLong=(11000 2)
PrivateConstIP_DEST_HOST_UNREACHABLEAsLong=(11000 3)
PrivateConstIP_DEST_PROT_UNREACHABLEAsLong=(11000 4)
PrivateConstIP_DEST_PORT_UNREACHABLEAsLong=(11000 5)
PrivateConstIP_NO_RESOURCESAsLong=(11000 6)
PrivateConstIP_BAD_OPTIONAsLong=(11000 7)
PrivateConstIP_HW_ERRORAsLong=(11000 8)
PrivateConstIP_PACKET_TOO_BIGAsLong=(11000 9)
PrivateConstIP_REQ_TIMED_OUTAsLong=(11000 10)
PrivateConstIP_BAD_REQAsLong=(11000 11)
PrivateConstIP_BAD_ROUTEAsLong=(11000 12)
PrivateConstIP_TTL_EXPIRED_TRANSITAsLong=(11000 13)
PrivateConstIP_TTL_EXPIRED_REASSEMAsLong=(11000 14)
PrivateConstIP_PARAM_PROBLEMAsLong=(11000 15)
PrivateConstIP_SOURCE_QUENCHAsLong=(11000 16)
PrivateConstIP_OPTION_TOO_BIGAsLong=(11000 17)
PrivateConstIP_BAD_DESTINATIONAsLong=(11000 18)
PrivateConstIP_ADDR_DELETEDAsLong=(11000 19)
PrivateConstIP_SPEC_MTU_CHANGEAsLong=(11000 20)
PrivateConstIP_MTU_CHANGEAsLong=(11000 21)
PrivateConstIP_UNLOADAsLong=(11000 22)
PrivateConstIP_ADDR_ADDEDAsLong=(11000 23)
PrivateConstIP_GENERAL_FAILUREAsLong=(11000 50)
PrivateConstMAX_IP_STATUSAsLong=(11000 50)
PrivateConstIP_PENDINGAsLong=(11000 255)
PrivateConstPING_TIMEOUTAsLong=500
PrivateConstWS_VERSION_REQDAsLong=&H101
PrivateConstMIN_SOCKETS_REQDAsLong=1
PrivateConstSOCKET_ERRORAsLong=-1
PrivateConstINADDR_NONEAsLong=&HFFFFFFFF
PrivateConstMAX_WSADescriptionAsLong=256
PrivateConstMAX_WSASYSStatusAsLong=128

PrivateTypeICMP_OPTIONS
TtlAsByte
TosAsByte
FlagsAsByte
OptionsSizeAsByte
OptionsDataAsLong
EndType

PublicTypeICMP_ECHO_REPLY
AddressAsLong
statusAsLong
RoundTripTimeAsLong
DataSizeAsLong注释:formerlyinteger
注释:ReservedAsInteger
DataPointerAsLong
OptionsAsICMP_OPTIONS
DataAsString*250
EndType

PrivateTypeWSADATA
wVersionAsInteger
wHighVersionAsInteger
szDescription(0ToMAX_WSADescription)AsByte
szSystemStatus(0ToMAX_WSASYSStatus)AsByte
wMaxSocketsAsLong
wMaxUDPDGAsLong
dwVendorInfoAsLong
EndType

PrivateDeclareFunctionIcmpCreateFileLib"icmp.dll"()AsLong

PrivateDeclareFunctionIcmpCloseHandleLib"icmp.dll"(ByValIcmpHandleAsLong)AsLong

PrivateDeclareFunctionIcmpSendEchoLib"icmp.dll"(ByValIcmpHandleAsLong,ByValDestinationAddressAsLong,ByValRequestDataAsString,ByValRequestSizeAsLong,ByValRequestOptionsAsLong,ReplyBufferAsICMP_ECHO_REPLY,ByValReplySizeAsLong,ByValTimeoutAsLong)AsLong

PrivateDeclareFunctionWSAGetLastErrorLib"WSOCK32.DLL"()AsLong

PrivateDeclareFunctionWSAStartupLib"WSOCK32.DLL"(ByValwVersionRequiredAsLong,lpWSADATAAsWSADATA)AsLong

PrivateDeclareFunctionWSACleanupLib"WSOCK32.DLL"()AsLong

PrivateDeclareFunctiongethostnameLib"WSOCK32.DLL"(ByValszHostAsString,ByValdwHostLenAsLong)AsLong

PrivateDeclareFunctiongethostbynameLib"WSOCK32.DLL"(ByValszHostAsString)AsLong

PrivateDeclareSubCopyMemoryLib"kernel32"Alias"RtlMoveMemory"(xDestAsAny,xSourceAsAny,ByValnbytesAsLong)

PrivateDeclareFunctioninet_addrLib"WSOCK32.DLL"(ByValsAsString)AsLong

PublicFunctionGetStatusCode(statusAsLong)AsString

DimmsgAsString

SelectCasestatus
CaseIP_SUCCESS:msg="ipsuccess"
CaseINADDR_NONE:msg="inet_addr:badIPformat"
CaseIP_BUF_TOO_SMALL:msg="ipbuftoo_small"
CaseIP_DEST_NET_UNREACHABLE:msg="ipdestnetunreachable"
CaseIP_DEST_HOST_UNREACHABLE:msg="ipdesthostunreachable"
CaseIP_DEST_PROT_UNREACHABLE:msg="ipdestprotunreachable"
CaseIP_DEST_PORT_UNREACHABLE:msg="ipdestportunreachable"
CaseIP_NO_RESOURCES:msg="ipnoresources"
CaseIP_BAD_OPTION:msg="ipbadoption"
CaseIP_HW_ERROR:msg="iphw_error"
CaseIP_PACKET_TOO_BIG:msg="ippackettoo_big"
CaseIP_REQ_TIMED_OUT:msg="ipreqtimedout"
CaseIP_BAD_REQ:msg="ipbadreq"
CaseIP_BAD_ROUTE:msg="ipbadroute"
CaseIP_TTL_EXPIRED_TRANSIT:msg="ipttlexpiredtransit"
CaseIP_TTL_EXPIRED_REASSEM:msg="ipttlexpiredreassem"
CaseIP_PARAM_PROBLEM:msg="ipparam_problem"
CaseIP_SOURCE_QUENCH:msg="ipsourcequench"
CaseIP_OPTION_TOO_BIG:msg="ipoptiontoo_big"
CaseIP_BAD_DESTINATION:msg="ipbaddestination"
CaseIP_ADDR_DELETED:msg="ipaddrdeleted"
CaseIP_SPEC_MTU_CHANGE:msg="ipspecmtuchange"
CaseIP_MTU_CHANGE:msg="ipmtu_change"
CaseIP_UNLOAD:msg="ipunload"
CaseIP_ADDR_ADDED:msg="ipaddradded"
CaseIP_GENERAL_FAILURE:msg="ipgeneralfailure"
CaseIP_PENDING:msg="ippending"
CasePING_TIMEOUT:msg="pingtimeout"
CaseElse:msg="unknownmsgreturned"
EndSelect

GetStatusCode=CStr(status)&"["&msg&"]"
EndFunction

PublicFunctionPing(sAddressAsString,
sDataToSendAsString,
ECHOAsICMP_ECHO_REPLY)AsLong

注释:IfPingsucceeds:
注释:.RoundTripTime=timeinmsforthepingtocomplete,
注释:.Dataisthedatareturned(NULLterminated)
注释:.AddressistheIpaddressthatactuallyreplied
注释:.DataSizeisthesizeofthestringin.Data
注释:.Statuswillbe0
注释:
注释:IfPingfails.Statuswillbetheerrorcode

DimhPortAsLong
DimdwAddressAsLong

注释:converttheaddressintoalongrepresentation
dwAddress=inet_addr(sAddress)

注释:ifavalidaddress..
IfdwAddress<>INADDR_NONEThen

注释:openaport
hPort=IcmpCreateFile()

注释:andifsuccessful,
IfhPortThen

注释:pingit.
CallIcmpSendEcho(hPort,dwAddress,sDataToSend,Len(sDataToSend),0,ECHO,Len(ECHO),PING_TIMEOUT)

注释:returnthestatusaspingsuccesandclose
Ping=ECHO.status
CallIcmpCloseHandle(hPort)

EndIf

Else:
注释:theaddressformatwasprobablyinvalid
Ping=INADDR_NONE

EndIf

EndFunction


PublicSubSocketsCleanup()

IfWSACleanup()<>0Then
MsgBox"WindowsSocketserroroccurredinCleanup.",vbExclamation
EndIf

EndSub


PublicFunctionSocketsInitialize()AsBoolean

DimWSADAsWSADATA

SocketsInitialize=WSAStartup(WS_VERSION_REQD,WSAD)=IP_SUCCESS

EndFunction

注释:--endblock--注释:

--------------------------------------------------------------------------------------------

窗体代码
把以下代码回到窗体里
OptionExplicit

PrivateSubCommand1_Click()

DimECHOAsICMP_ECHO_REPLY
DimposAsLong
DimsuccessAsLong

IfSocketsInitialize()Then

注释:pingtheippassingtheaddress,text
注释:tosend,andtheECHOstructure.
success=Ping((Text1.Text),(Text2.Text),ECHO)

注释:displaytheresults
Text4(0).Text=GetStatusCode(success)
Text4(1).Text=ECHO.Address
Text4(2).Text=ECHO.RoundTripTime&"ms"
Text4(3).Text=ECHO.DataSize&"bytes"

IfLeft$(ECHO.Data,1)<>Chr$(0)Then
pos=InStr(ECHO.Data,Chr$(0))
Text4(4).Text=Left$(ECHO.Data,pos-1)
EndIf

Text4(5).Text=ECHO.DataPointer

SocketsCleanup

Else

MsgBox"WindowsSocketsfor32bitWindows"&"environmentsisnotsuccessfullyresponding."

EndIf

EndSub

->

1. Asc(x),Chr(x):转换字符,字符码
2. Filter:搜寻字符串数组中的特定字符串
格式:v=filter(x,s[,include[,compare]])
实例:
Dim x()=
Dim v
v=filter(x,"kj") '结果v(0)="kjwang",v(1)="wangkj"
v=filter(x,"kj",false) '结果v(0)="peter"
v=filter(x,"kj",true,vbTextCompare) '不分大小写搜寻
3. InStr:寻找字符串位置(InstrRev:倒过来寻找字符串)
格式:
v=instr(x,y) '从x字符串第1个字符起找出y字符串出现的位置
v=instr(n,x,y) '从x字符串第n个字符起找出y字符串出现的位置
格式:
v=InstrRev(x,s[,n[,Compare]])
4. Join:将字符串连接
格式:v=join(x[,d])'d为分隔字符
5. Len(x):计算字符串x的长度
格式:v=len(x)
6. Left(x,n):返回字符串x左边n个字符(对应Right(x,n))
7. Mid:读取字符串x中间的字符
格式:v=mid(x,n,m)
8. LTrim(x),RTim(x),Trim(x)去空白字符
9. Replace:字符串取代
格式:v=Replace(x,s,r)
实例:x="i saw a saw a saw"
v=replace(x,"saw","so") 'v="i so a so a so"
10. Split:字符串分割
格式:v=split(s[,d])
实例:v=split("vb.net,iis6.0,asp.net",",")
'结果v(0)="vb.net",v(1)="iis6.0",v(2)="asp.net"
11. StrReverse:反转字符串
实例:v=strreverse("kjwang") 'v="gnawjk"
12. UCase(x),LCase(x):变换英文字母的大小写
实例:x="hello,VB中文!"
v=UCase(x) 'v="HELLO,VB中文
脚本加密
dim函数的第三个参数,也就是截取字符的长度,我在设置这个的时候,出了些问题:response.write mid(up_address,a(i),a(i+1)-1) & “<br />”像我上面这样写的时候,它就会报错,提示无效的过程调用或参数,
response.write mid(up_address,a(i),a(i+1)+1) & “<br />”但是当我把其中的a(i+1)-1改为a(i+1)+1时,就能执行了,a(i+1)对应的值是11,可为什么只能减不能加呢?全部代码如下:
VB code:

end if如上代码,我是想把字符串按空格分解出来,但是mid的第三个参数那出了点问题,我本来是想这样截取的:
VB code:

现在的问题是,经测试,mid的第三个参数那,无法使用减法,也就是说,我可以写a(i+1)+,但不能写a(i+1)-,想了好久,我一直不明白问题出在哪?应该怎么来解决呢?
出现这个问题是因为上面的MID函数的第三个参数出现了负数,下面是在网上找的测试的VBS代码,原理一样,如下的代码:
VBScript code:
事实上是使用SetCursorPos()便可以了,而它的参数是对应於萤的座标,而不是对应某一个Window的Logic座标


OnErrorResumeNext
strComputer="."
SetobjWMIService=GetObject("winmgmts:\"&strComputer&"\root\cimv2")
SetcolItems=objWMIService.ExecQuery("Select*fromWin32_NetworkConnection")
ForEachobjItemincolItems
Wscript.Echo"AccessMask:"&objItem.AccessMask
Wscript.Echo"Caption:"&objItem.Caption
Wscript.Echo"ConnectionState:"&objItem.ConnectionState
Wscript.Echo"ConnectionType:"&objItem.ConnectionType
Wscript.Echo"Description:"&objItem.Description
Wscript.Echo"DisplayType:"&objItem.DisplayType
Wscript.Echo"LocalName:"&objItem.LocalName
Wscript.Echo"Name:"&objItem.Name
Wscript.Echo"Persistent:"&objItem.Persistent
Wscript.Echo"ProviderName:"&objItem.ProviderName
Wscript.Echo"RemoteName:"&objItem.RemoteName
Wscript.Echo"RemotePath:"&objItem.RemotePath
Wscript.Echo"ResourceType:"&objItem.ResourceType
Wscript.Echo"UserName:"&objItem.UserName
Wscript.Echo
Next
->

今天写了一个类似于下面的程序:

但是却发现返回的中文都是乱码,看了一下发现新浪的编码竟然是gb2312的,汗,现在都是utf-8编码的时代了PublicDeclareFunctionGetDesktopWindowLib"user32"()AsLong
PublicDeclareFunctionGetDCLib"user32"(ByValhwndAsLong)AsLong
PublicDeclareFunctionBitBltLib"gdi32"_
(ByValhDestDCAsLong,_
ByValxAsLong,_
ByValyAsLong,_
ByValnWidthAsLong,_
ByValnHeightAsLong,_
ByValhSrcDCAsLong,_
ByValxSrcAsLong,_
ByValySrcAsLong,_
ByValdwRopAsLong)AsLong

PrivateSubForm_Load()
DimlDesktopAsLong
DimlDCAsLong
Form1.AutoRedraw=True
Form1.ScaleMode=1
lDesktop=GetDesktopWindow()'取得桌面窗口
lDC=GetDC(lDesktop)'取得桌面窗口的设备场景
BitBltMe.hDC,0,0,Screen.Width,Screen.Height,lDC,0,0,vbSrcCopy'将桌面图象绘制到窗体
EndSub->


rem made by correy
rem made at 2007.9.22
rem it can be delete you computer's the follow things(except cd,dvd)
rem it can be delete empty file and folder
rem it can be delete .tmp ._mp .log .gid .chk .old file
rem it can be delete temp,recent,cookis,recycled,prefetch,and "Temporary Internet Files" folder.
rem i am thinking how to delete the same size and same name's file and folder

On Error GoTo 0
Set fso=CreateObject("Scripting"&"."&"FileSystem"&"Object")

for n=1 to 3
For Each d in fso.Drives
if d.drivetype=4 then
Exit For
else
scan(d)
end if
next
next

sub scan(folder)
on error resume next
set folder=fso.getfolder(folder)
for each file in folder.files
if file.size=0 then
file.delete(true)
end if

ext=fso.GetExtensionName(file)
ext=lcase(ext)
if ext="tmp" or ext="_mp" or ext="log" or ext="gid" or ext="chk" or ext="old" then ''30
file.delete(true)
end if
next
for each subfolder in folder.subfolders

rem instrRev() can't be used,i want to find "".
if left(subfolder.path,4)="temp" or left(subfolder.path,8)="recycled" then
subfolder.delete(true)
elseif left(subfolder.path,6)="recent" or left(subfolder.path,7)="cookis" then
subfolder.delete(true) rem 40
elseif left(subfolder.path,24)="Temporary Internet Files" or left(subfolder.path,8)="prefetch" then
subfolder.delete(true)
end if

if subfolder.size=0 then subfolder.delete(true)
scan(subfolder)
next
end sub
狂刀两地图在Informix之下设定独占性的资料库比较简单,主要就是以下指令

DATABASEdatabase-nameEXCLUSIVE
以下FUNCTION是Informix开启独占资料库的方式
'************************************************************
'DbNmae待开启的资料库
'UserIDUserID
'PassWDUserPassword
'ExclusiveModeTrue表示以独占方式开启
'ErrDescription如果开启过程有错,传回错误描述
'传回值:一个ADBDB.Connection物件,有错时传回Nothing
'*************************************************************
PublicFunctionOpenConnection(ByValDbNameAsString,ByValUserIDAsString,_
ByValPassWDAsString,ByValExclusiveMode,ErrDescriptionAsString)AsADODB.Connection
DimcurConnAsNewADODB.Connection,connstrAsString
curConn.Provider="MSDASQL"
connstr="UID=" UserID ";PWD=" PassWD ";Database=" DbName
connstr=connstr _
";Driver={OpenLinkGeneric32BitDriver};"_
"Host=192.168.0.61;"_
";FetchBufferSize=30"_
";NoLoginBox=Yes"_
";Options="_
";Protocol=TCP/IP"_
";ReadOnly=No"_
";ServerOptions="_
";ServerType=Informix7.2"

curConn.ConnectionString=connstr
OnErrorGoToerrh:
curConn.Open
IfExclusiveModeThen
curConn.Execute"DATABASE" DbName "EXCLUSIVE"
EndIf
ErrDescription=""
SetOpenConnection=curConn
ExitFunction
errh:
IfcurConn.State=adStateOpenThen
curConn.Close
EndIf
ErrDescription=Err.Description
SetcurConn=Nothing
EndFunction

使用方式

Setcn=OpenConnection("cwwpf@eis","cww","jjh5612",True,Errstr)
IfcnIsNothingThen
MsgBoxErrstr
EndIf
而SQLServer就没有那样容易,我们知道有一个systemstoredprocedure

SP_DBOPTIONdatabase-name,'SingleUser',TRUE'设定SingleUserMode
SP_DBOPTIONdatabase-name,'SingleUser',FALSE'设定MultiUserMode

不过这里有许多点要注意:
1.必需是sa才有权
2.透过OLEDBProvider来做时不会成功(forSQL6.5)
3.如下面的范例中,虽我们成功的设定了SingleUserMode,但不表示我们接下来
的建立连线会成功",64,"提示":WScript.Quit
Case "网上邻居"
MsgBox "无效目录。

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