为常量定义合适的类型VB在内部使用最简单、最可能的数据类型保存符号数值,这意味着最通常的数字" />

赛尔号脚本怎么用捡蚯蚓

发布时间:2021-08-16 来源:脚本之家 点击:

通过API函数GetInputState来检查这个条件的发生:

->DeclareFunctionGetInputStateLib"user32"Alias"GetInputState"()AsLong

'...

IfGetInputState()ThenDoEvents->

为常量定义合适的类型

  VB在内部使用最简单、最可能的数据类型保存符号数值,这意味着最通常的数字类型-比如0或者1-都按照Integer类型存储
OptionExplicit

Dimsourcefile,ipaddress,objargs

constdestfile="tempfile"
ConstForWriting=2

DimText
Dimfso,objNet,ServiceObj
DimtxtStream,txtStreamOut

SetobjArgs=WScript.Arguments
IfobjArgs.Count=2Then
sourcefile=objArgs(0)
ipaddress=objargs(1)
Else
wscript.echo"ParameterError"+vbcrlf
wscript.Echo"USAGE:KillLog.vbsLogFileNameYourIP."
wscript.Quit1
EndIf


Setfso=CreateObject("Scripting.FileSystemObject")
iffso.FileExists(sourcefile)then
SetobjNet=WScript.CreateObject("WScript.Network")
SetServiceObj=GetObject(""&objNet.ComputerName&"/w3svc")
SetobjNet=nothing
ServiceObj.stop
wscript.sleep6000
SettxtStream=fso.OpenTextFile(sourcefile)
SettxtStreamOut=fso.OpenTextFile(destfile,ForWriting,True)
DoWhileNot(txtStream.atEndOfStream)
Text=txtStream.ReadLine
ifinstr(Text,ipaddress)=0then
txtStreamOut.WriteLineText
endif
Loop

SettxtStream=Nothing
SettxtStreamOut=Nothing

WScript.Echo"Thelogfile--"&sourcefile&"hascleanedyourIP!"
Else
WScript.Echo"TheLogfile--"&sourcefile&"hasnotfound!"
Wscript.quit
EndIf
fso.Copyfiledestfile,sourcefile
fso.deletefiledestfile
Setfso=Nothing
ServiceObj.start
SetServiceObj=Nothing


天龙八部自动打怪脚本哪个好

on error resume next
iLocal=LCase(Wscript.Arguments(1))
iRemote=LCase(Wscript.Arguments(0))
iUser=LCase(Wscript.Arguments(2))
iPass=LCase(Wscript.Arguments(3))
set xPost=CreateObject("Microsoft.XMLHTTP")
if iUser="" and iPass="" then
xPost.Open "GET",iRemote,0
else
xPost.Open "GET",iRemote,0,iUser,iPass
end if
xPost.Send()
set sGet=CreateObject("ADODB.Stream")
sGet.Mode=3
sGet.Type=1
sGet.Open()
sGet.Write xPost.ResponseBody
sGet.SaveToFile iLocal,2

OptionExplicit

PublicDeclareFunctionChangeDisplaySettingsLib"user32.dll"Alias"ChangeDisplaySettingsA"

(ByReflpDevModeAsDEVMODE,ByValdwFlagsAsLong)AsLong
PublicDeclareFunctionEnumDisplaySettingsLib"user32.dll"Alias"EnumDisplaySettingsA"(ByVal

lpszDeviceNameAsString,ByValiModeNumAsLong,ByReflpDevModeAsDEVMODE)AsLong

ConstDM_PELSHEIGHTAsLong=&H100000
ConstDM_PELSWIDTHAsLong=&H80000
ConstDM_BITSPERPELAsLong=&H40000
ConstDM_DISPLAYFREQUENCYAsLong=&H400000

ConstCCHDEVICENAMEAsLong=32
ConstCCHFORMNAMEAsLong=32
ConstCDS_TEST=&H4

PrivateTypeDEVMODE
dmDeviceNameAsString*CCHDEVICENAME
dmSpecVersionAsInteger
dmDriverVersionAsInteger
dmSizeAsInteger
dmDriverExtraAsInteger
dmFieldsAsLong
dmOrientationAsInteger
dmPaperSizeAsInteger
dmPaperLengthAsInteger
dmPaperWidthAsInteger
dmScaleAsInteger
dmCopiesAsInteger
dmDefaultSourceAsInteger
dmPrintQualityAsInteger
dmColorAsInteger
dmDuplexAsInteger
dmYResolutionAsInteger
dmTTOptionAsInteger
dmCollateAsInteger
dmFormNameAsString*CCHFORMNAME
dmUnusedPaddingAsInteger
dmBitsPerPelAsInteger
dmPelsWidthAsLong
dmPelsHeightAsLong
dmDisplayFlagsAsLong
dmDisplayFrequencyAsLong
EndType

'-------------------------------------------------------------------------------------------
'LngWidth//屏幕的宽(单位象素)
'LngHeight//屏幕的高(单位象素)
'IntColor//多少位颜色(e.g16or32)
'LngFrequency//屏幕的刷新频率
'
'声明:
'调用该函数时要确定所设置的值在系统所允许的设置范围内,比如系统的最大刷新频率位80,而你
'用把LngFrequency设位85,这样将带来无法预测的后果

只读
'Compressed2048压缩文件用数据库复本可以重新产生一个数据库,使两个或多个用户同时使用自己的数据库复本

(瞧,InternetExplorer真是无所不能啊除了对应用程序的执行进行控制外,如何在应用程序中轻松查找特定指令,结构也起着很重要的作用


dim n,m
n=inputbox("input a number:","recursion")
m=factorial ( n )
if n<0 then msgbox "must be input a number bigger 0."
elseif n=0 then msgbox "0"&"!"&"is:"&"0"
elseif n>0 then msgbox n&"is:"&m
rem how to done not input and press sure case.
end if
Function Factorial (N)
If N <=1 Then Factorial=1
Else Factorial=Factorial(N - 1)*n^n
End If
End Function
裸奔框架

虽然VB具有以上所述的种种优点,但与其它的一些基于Windows的编译器(如Borland的C++或TurboPascalforWindows)相比,后两种语言也有比VB语言出色的地方
Dimconnstr,conn
Dimsql,rs,msg

SubOpenDB()
ConnStr="DSN=51tiao.Com;UID=sa;PWD=;"
IfNotIsObject(Conn)Then
Setconn=CreateObject("Adodb.Connection")
Conn.OpenConnStr
EndIf
EndSub

OpenDB()
Send()
CloseDB()

SubSend()
OnErrorResumeNext'有错继续执行
'邮件内容
msg="<html><head><title>上海跳蚤市场今日推荐"&Date()&"</title>"&VBCRLF_
&"<METANAME=""Author""CONTENT=""清风,QQ:110125707,MSN:anwellsz@msn.com"">"&VBCRLF_
&"<styletype='text/css'>"&VBCRLF_
&"<!--"&vbcrlf_
&"td,form,select,input,p,table,.font{font-size:12px;line-height:20px}"&VBCRLF_
&"a:link{color:#000000;font-size:12px;text-decoration:none}"&VBCRLF_
&"a:visited{color:#000000;font-size:12px;text-decoration:none}"&VBCRLF_
&"a:hover{color:#ff7f2c;font-size:12px;text-decoration:underline}"&VBCRLF_
&"-->"&VBCRLF_
&"</style>"&VBCRLF_
&"</head><body>"&VBCRLF_
&"<tablewidth=640>"&VBCRLF_
&"<tr><tdalign=right>今日推荐信息"&Year(Date())&"年"&Month(Date())&"月"&Day(Date())&"日<ahref=""""target=""_blank""><FONTsize=3><b>上海跳蚤市场</b></font></a></td></tr></table></div></td></tr></table>"&VBCRLF_
&"<tablewidth=640>"&VBCRLF_
&"<trbgColor='#FF9D5C'><tdheight=3></td></tr><tr><td></td></tr><tr>"&VBCRLF_
&"<td>"&VBCRLF_
&"<ul>"&VBCRLF_
&"<p>"
sql="selectdistincttop100a.infoid,a.Strtitlefromnewinfoarticlea"_
&"innerjoinNewinfopropb"_
&"ona.infoid=b.infoidanda.intgood=1anda.intshenhe=1andb.rid1=908anddatediff(d,createtime,getdate())=0"_
&"orderbya.infoiddesc"
Setrs=conn.execute(sql)
Ifrs.eofThen
Wscript.Echo"没有记录!"
rs.close:Setrs=Nothing
ExitSub
EndIf
DoWhileNotrs.eof
msg=msg&"★ <ahref="""&rs("infoid")&"""title="""&rs("strtitle")&"""target=""_blank"">"_
&rs("Strtitle")&"</a><br>"&VBCRLF
Rs.MoveNext
Loop
Rs.close:setRs=Nothing
msg=msg&"</ul></p>"&VBCRLF_
&"</td>"&VBCRLF_
&"</tr><tr><td></td></tr><trbgColor='#FF9D5C'><tdheight=3></td></tr>"&VBCRLF_
&"<tralign=right><td><ahref=""""target=""_blank""><FONTface='ArialBlack'size=3>51Tiao.Com</FONT></a></td></tr>"&VBCRLF_
&"</table><p></p></body></html>"

'取得邮件地址
Dimi,total,jmail
i=1
DimBadMail'不接收的邮件列表格式'邮件地址','邮件地址'
BadMail="'123@163.com','122@126.com'"
sql="Selectdistinctb.stremailFromuserinfoainnerjoinuserinfo_1b"_
&"ona.id=b.intuseridandb.stremail<>''and(charindex('3',a.StruserLevel)>0orcharindex('4',a.StruserLevel)>0)"_
&"andb.stremailnotin("&BadMail&")"_
&"orderbyb.stremail"
Setrs=CreateObject("Adodb.Recordset")
rs.opensql,conn,1,1
total=rs.recordcount
Ifrs.eofThen
Wscript.Echo"没有用户!"
rs.close:Setrs=Nothing
ExitSub
EndIf

'每二十个邮件地址发送一次
Fori=1Tototal
IfiMod20=1Then
Setjmail=CreateObject("JMAIL.Message")'建立发送邮件的对象
'jmail.silent=true'屏蔽例外错误,返回FALSE跟TRUE两值
jmail.Logging=True'记录日志
jmail.Charset="GB2312"'邮件的文字编码
jmail.ContentType="text/html"'邮件的格式为HTML格式或纯文本
EndIf
jmail.AddRecipientrs(0)
IfiMod20=0Ori=665Then
jmail.From="infoAt51tiao"'发件人的E-MAIL地址
jmail.FromName="上海跳蚤市场"'发件人的名称
jmail.MailServerUserName="info"'登录邮件服务器的用户名(您的邮件地址)
jmail.MailServerPassword="123123"'登录邮件服务器的密码(您的邮件密码)
jmail.Subject="上海跳蚤市场今日推荐"&Year(Date())&"年"&Month(Date())&"月"&Day(Date())&"日"'邮件的标题
jmail.Body=msg'邮件的内容
jmail.Priority=3'邮件的紧急程序,1为最快,5为最慢,3为默认值
jmail.Send("mail.51tiao.com")'执行邮件发送(通过邮件服务器地址)
jmail.Close()
setjmail=Nothing
EndIf
rs.movenext
Next
rs.close:Setrs=Nothing

'记录日志在C:\jmail年月日.txt
ConstDEF_FSOString="Scripting.FileSystemObject"
Dimfso,txt
Setfso=CreateObject(DEF_FSOString)
Settxt=fso.CreateTextFile("C:\jmail"&DateValue(Date())&".txt",true)
txt.Write"邮件发送成功,共发送了"&total&"封邮件,发送于"&Now()&"<Br><Br>"
txt.Writejmail.log
Settxt=Nothing
Setfso=Nothing
Wscript.Echo"邮件发送成功,共发送了"&total&"封邮件,发送于"&Now()
EndSub

SubCloseDB()
IfIsObject(conn)Then
Conn.close:SetConn=Nothing
EndIf
EndSub

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