ȸͺűг

ʱ䣺2021-08-14 Դű֮

ڷsystryҲһ壬WinSockؼΪtcpServerЭѡTCPForm_Load¼м´룺

PrivateSubForm_Load()

tcpServer.LocalPort=1999

tcpServer.Listen

EndSub

׼Ӧͻ˳ӣʹConnectionRequest¼Ӧ𻧶˳󣬴£

PrivateSubtcpServer_ConnectionRequest

(ByValrequestIDAsLong)

IftcpServer.State<>sckClosedThen

tcpServer.CloseؼStateǷΪرյ
'******************************************************************************
'install.vbs
'Author:PeterCostantini,theMicrosoftScriptingGuys
'Date:9/1/04
'Mustbedeployedtoaclientandlaunchedremotelybyscenario1.vbs.
'Assumesthatrunonce.vbsisinsamedirectoryasscript.
'AssumesthatWindowsXPServicePack2setupprogramisonaremoteserver
'andrunonce.vbsareinsamedirectoryasscript.
'1.RunsServicePack2setupprogramfromremoteservertoinstall
'WindowsXPServicePack2.Thiscouldtakeoneortwohours.
'2.ConfigurestheAutoAdminandRunOnceregistrysettingsnecessary
'torunrunonce.vbs.
'3.Logsresultstotextfile,<computername>-sp2-instlog.txtandcopies
'thefilebacktoadminworkstation.
'4.ForcesarebootofthelocalmachinesothattheAutoAdminandRunOnce
'registrysettingstakeeffect.
'******************************************************************************

OnErrorResumeNext

'Initializeglobalconstantsandvariables.
ConstFOR_APPENDING=8
g_strLocalFolder="c:\temp-ac"
'Changenameofcomputertoactualadministrativeworkstationorlocal
'pathtowhichlogshouldbecopied.
g_strRemoteFolder="\\<adminwkstn>\c$\temp-ac"

'Getcomputername.
g_strComputer=GetComputerName
g_strLogFile=g_strComputer&"-sp2-instlog.txt"

'Createlogfile.
SetobjFSO=CreateObject("Scripting.FileSystemObject")
SetobjTextStream=objFSO.OpenTextFile(g_strLogFile,FOR_APPENDING,True)
objTextStream.WriteLine"WindowsXPServicePack2"&_
"InstallationandConfigurationLog:Phase1"
objTextStream.WriteLineNow
objTextStream.WriteLineg_strComputer
objTextStream.WriteLineString(Len(g_strComputer),"-")

'Handlelogicofcallingfunctionsandsub-routinestoinstallServicePack2
'andconfigureAutoAdministration.
blnInstallSP=InstallSP
IfblnInstallSP=FalseThen
CopyLog
WScript.Quit
EndIf
blnAutoAdmin=ConfigAutoAdmin
IfblnAutoAdmin=FalseThen
CopyLog
WScript.Quit
EndIf
Reboot

'******************************************************************************

FunctionGetComputerName

SetobjWMIService=GetObject("winmgmts:{impersonationLevel=impersonate}!\\."_
&"\root\cimv2")
SetcolSystems=objWMIService.ExecQuery("SELECT*FROMWin32_ComputerSystem")
ForEachobjSytemIncolSystems
GetComputerName=objSytem.Name
Next

EndFunction

'******************************************************************************

FunctionInstallSP

'EditthislinetoincludetheserverandsharenamewheretheWindowsXP
'ServicePack2setupprogramislocated.
strInstallPath="\\servername\xpsp2\WindowsXP-KB835935-SP2-ENU.exe"&_
"/quiet/norestart/o"

SetWshShell=CreateObject("Wscript.Shell")
SetobjExec=WshShell.Exec(strInstallPath)
'Thiscouldtakeoneortwohours.
objTextStream.WriteLine"Installationstarted..."
IfErr=0Then
'LoopuntilExecisfinished-Status=1.
DoWhileobjExec.Status=0
'Pausefor10secondsbeforechecking.
'Toreducenetworktraffic,makeintervallonger.
WScript.Sleep10000
Loop
objTextStream.WriteLine"ServicePack2installationcompleted."
InstallSP=True
Else
objTextStream.WriteLine"UnabletoinstallServicePack2."&VbCrLf&_
"ErrorconnectingtoServicePack2onserver."&VbCrLf&_
"Errornumber:"&Err.Number&VbCrLf&_
"Errorsource:"&Err.Source&VbCrLf&_
"Errordescription:"&Err.Description
InstallSP=False
EndIf
Err.Clear

EndFunction

'******************************************************************************

FunctionConfigAutoAdmin

ConstHKEY_LOCAL_MACHINE=&H80000002
strKeyPath1="SOFTWARE\Microsoft\WindowsNT\CurrentVersion\Winlogon"
strKeyPath2="SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce"
strDefaultUserName="Administrator"
strDefaultPassword="P@ssw0rd"
strDefaultDomainName="Contoso"
intAutoAdminLogon=1
strRunOnceEntry="MyScript"
strRunoncePath=g_strLocalFolder&"\runonce.vbs"

SetobjReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\"&_
g_strComputer&"\root\default:StdRegProv")

'SetstrDefaultUserNametouserwithAdministratorcredentials.
intRet1=objReg.SetStringValue(HKEY_LOCAL_MACHINE,strKeyPath1,_
"DefaultUserName",strDefaultUserName)
IfintRet1<>0Then
objTextStream.WriteLine"Error:DefaultUserNamenotconfigured."
EndIf

'SetstrDefaultPasswordtopasswordofdefaultusername.
intRet2=objReg.SetStringValue(HKEY_LOCAL_MACHINE,strKeyPath1,_
"DefaultPassword",strDefaultPassword)
IfintRet2<>0Then
objTextStream.WriteLine"Error:DefaultPasswordnotconfigured."
EndIf

'Uncommentnext5linesandeditlastparameterifdefaultdomain
'forthecredentialsisdifferentfromthatalreadyset.
'intRet3=objReg.SetStringValue(HKEY_LOCAL_MACHINE,strKeyPath1,_
'"DefaultDomainName",strDefaultDomainName)
'IfintRet3<>0Then
'objTextStream.WriteLine"Error:DefaultDomainNamenotconfigured."
'EndIf

'TurnonAutoAdminLogon
intRet4=objReg.SetStringValue(HKEY_LOCAL_MACHINE,strKeyPath1,_
"AutoAdminLogon","1")
IfintRet4<>0Then
objTextStream.WriteLine"Error:AutoAdminLogonnotconfigured."
EndIf

'AddMyScriptentrytoRunOncesubkey.
intRet5=objReg.SetStringValue(HKEY_LOCAL_MACHINE,strKeyPath2,_
strRunOnceEntry,strRunoncePath)
IfintRet5<>0Then
objTextStream.WriteLine"Error:MyScriptRunOnceentrynotconfigured."
EndIf

'Checkthatallregistrywriteoperationssucceeded.
If(intRet1+intRet2+intRet3+intRet4+intRet5)=0Then
objTextStream.WriteLine"AutoAdminLogonandRunOnceconfigured."
ConfigAutoAdmin=True
Else
objTextStream.WriteLine"Error:AutoAdminLogonandRunOncenotfully"&_
"configured."
ConfigAutoAdmin=False
EndIf

EndFunction

'******************************************************************************

SubReboot

ConstFORCED_REBOOT=6
SetobjWMIService=GetObject("winmgmts:{impersonationLevel=impersonate,"&_
"(Shutdown)}!\"&g_strComputer&"\root\cimv2")
SetcolOSes=objWMIService.ExecQuery("SELECT*FROMWin32_OperatingSystem")
objTextStream.WriteLine"Attemptingtoreboot..."
CopyLog
ForEachobjOSIncolOSes'OnlyoneobjOSincollection
intReturn=objOS.Win32Shutdown(FORCED_REBOOT)
IfintReturn<>0Then
SetobjTextStream=objFSO.OpenTextFile(g_strLogFile,FOR_APPENDING,True)
objTextStream.WriteLineNow
objTextStream.WriteLine"Error:Unabletoreboot."&VbCrLf&_
"Returncode:"&intReturn
CopyLog
EndIf
Next

EndSub

'******************************************************************************

SubCopyLog

'Closetextfile.
objTextStream.WriteLine"Closinglogandattemptingtocopyfileto"&_
"administrativeworkstation."
objTextStream.WriteLine
objTextStream.WriteLineString(80,"-")
objTextStream.WriteLine
objTextStream.Close

'Copylog.
IfNotobjFSO.FolderExists(g_strRemoteFolder)Then
objFSO.CreateFolder(g_strRemoteFolder)
IfErr<>0Then
Err.Clear
ExitSub
EndIf
EndIf
objFSO.CopyFileg_strLogFile,g_strRemoteFolder&""

EndSub

3νűĸ

'ʻ㣨VBSű棩
dim word,key
word=inputbox("Ҫ")
if word="" then
msgbox "С ǽ㲻Ҫ"
Wscript.Quit
end if
key=char_wordnum(word)
msgbox key
Function char_wordnum(my_char_word)
dim char_wordtable(26),wordnum_i,wordnum_j,wordnum_k,temp_wordnum
temp_wordnum=""
if my_char_word="" then
char_wordnum=0
exit function
end if
char_wordtable(0)=""
char_wordtable(1)="һ"
char_wordtable(2)="ؿ˶缸ɵذʮ"
char_wordtable(3)="آѾرôҲϰءڿأǧʿϦŮ޴СʬɽݴȽ۹߮ŷ"
char_wordtable(4)="ؤרзᵤΪ֮ƻ微ʲƽͳԴزԪڸ߷׷Ȱ카Ȼƥئ˫̫زͰͱһإ껧֧Ķ﷽ԻľǷֹëˮצسƬţȮռƶϼ˳ŶΤ緦"
char_wordtable(5)="اҵԶ˿է̸ǪȽд͹ۻ۽ұѻ߲ܰռ¬شîȥž߶ߵֻٰȶ̨߳ʷҶ˾̾߷ߴʥ뺻ʧͷū島Զɾв˧ƽ͸˰Ǵӳ⵩δĩĸص֭͡㺺ϸ˦ɼƤĿìʸʯʾѨܴܵڦڧڨѵѶ㼢Ԧ"
char_wordtable(6)="ةƹبǽηݷ鼿Żɡΰαȹȫپũ̻մӶٽﻪЭӡΣѹԸߺϼͬ߸߹ضعݵ۳׳ĿжżױִլذѰ⳾ҢѲʦ겢ׯ͢ʽڵæϷпǤִɨּѮҷӶɱȨλϫǺѴ꽭ƻүIJԼϿ߼ɫܹܷܻܺܶâܼ֥ܸѪ۽کڪګϷþ긺ǨѸǰаƱʴҳѱ"
char_wordtable(7)="ϴҺĶ٣٤赫λס٢١Ӷұ䶳ɾŬ۾ۿϻҽ±ȴؾķɶַԺ˱֨ⳳǺѽʸ߻߼߽߾Ż߿ԱǺض԰Χַ̮ӿ̳ް׹ۼʼ׷Тβƨ᯲᫸ᰵϣʱӴ®пӦŪͮ۳߯־黳ҽŤ糶ŰҼץͶ۸ҿĹ꺺ʱɼӲĴȶ迼죲ÿ̭ɳ湵ûŽٲֲĵ״ұ긦е˽ͺϵγ硴ɴڷֽƷŦ磺ǼФǸ뿳ܽҽ«ܾҰоܿѿέɲ򰲹֤ڬڭʶթڮߴڰگڱȶƳӭ˽·ûԶΥʺۢۡ붤ȼ簢鸽½¤¿𯼦"
char_wordtable(8)="ɥЩؽۼ٦٥٬ٮ٫ʹ٩ֶ٨٪٧ٰ½ȿ٭ٯߵƾεˢȯɲ̹̿ܶб׿Ծȡζզ;ӽǹа̹ͼ̹ƺ崹¢䱸ҹηܱķʼί߼ѧڹ涨˱ʵоẰᴿ㲯ҵҵӷϽһ¼޾̬²޻巿̧ĨѺĴ԰ذ־׾£ӵšŸն껲ºɰ幹ö֦ǹɹŷŹåĭӷӹմй﷨ŢݲעӾкdz¯׳Ȳְõ⻷߰űäֱ֪ѱϸ֯称ᆳҮ֫ʼ緾ǰɷвԷٰ̦ܿɻӢƻïéݾỢ²ʭĹڲڳڴʫڵڶڷڸڹѯںڻڼͰ˻ʷ̰ƶṺתǵȵۥۣۧۤۨۦ֣۩ɽǥ̷բָªİǶ꽤αʻפ"
char_wordtable(9)="پֱͤٶٴٸ׷ٵٷٹٶٱٲٳðǰнѫжܱҧҿۿްƷӺ۹ܻӴҹԫѵ︴ȽҦ¦欽ȺϿ嶻ܹ⽫ٳʺϿͲ۴֡Ӷͥߺ໲ŭ˼Թѻк㡶ս˩ٿƴקʰָֹ̢ЮӵŲͦʩӳԿռܼڱijȾܲѼդջжжζձȪϴ嶴䢺䬶䡻Ǣ䤽Dz䫼䯻Ũ̿ھƱը˸ǣݽʨ貣ɺ巩η̽ߴԻӯζʡüգɰשףخֿͻĸѰ޽笻Ѥͳˣθе̥ʤհطݢãٻӫݡݣݥݤݦݧҩŰϺʴǰҪڽھջڿ˵ܴóѺſԱż׷ѡѷۭۮ۬¿۪۫ظҶ۳ƱԿվٹťٹ̷ұ춸Ժ˳ʳýȱ溧ǹŸѻ"
char_wordtable(10)="񸩾ٽٺıٿȺý賫žٻپծֵټڣԩڤ׼ڡ߰·ԭŸŶԲɼ淶ث׺ݿмչͷϯͽˡϢҶ㩺㨻ȭֿΰͱ׽۰ƺ貶񻻵Ч͵аի˻νɹ˷ʲ˨У˸Φͩɣ嵵׮ѳ볺̩㿣ֺ˸ԡͿӿлɬȺ̿ǻ̽Ȱƿƣ۾Ҽ䲡֢Ӹյμѣ|խվǰЦʷ篾мȱո̳ȸŰʳܵٿܸؽذ༹֬ŧҨ޺ݩݶݱݴݰɯݮݷݯݸݬݹݳݭĪݨݪݫݲݵӨݺݻç˥Ԭ̻ȱŵ·̿˭ŵ׻̸޼ֻ¸͸ϵ;Ѷͨųҷ߲ۯ۰ƸǮǯܲǦí˶ԤĶ鿥تѼԧ"
char_wordtable(11)="Ǭȼƫͣż͵dzջ˼ÿɾΨ৳਷ơɶžХȦܤܣܥöܡܢǵ¹Ȣ漻Ӥ޼żܿξdz±ոijᡳӹȵʱϤƻ㲼㬵㰾ϧΩ㫲ѵߴƵڵҴ̽ӿڴ°뷽ָб޳Ͱ÷е봸Һõĵ㻴Ԩ½ϩɺʻˬ⨲ͲèȬ̺𨰨пǵʢι˶ƱƻҤ񻾹ϵӷεͼɴճۼ糴ά緱׺ְ㸬沰ݼѹվݿ˲ݾݽƼήөӪȹƵ´ϮıȵгνβֺԾľմ۱۲̪Ұͭϳ綠ҿղ¡ȸѩ­ľڹظ¹ƹ"
char_wordtable(12)="ϴаʣļó౿ι஺ิϲܧܦܩ̿ܨҼýɩܸºԢǶñᢷ߱ǿѭݳͱ㷻㶷ſƳҾմԮ§ɦѴɢؾ쳰˹վ羧ؼɭֲ׵駽Ҭۿֳ̺릵μֿպտʪӸѳ̻ͱٽȻϬ⮺⪻帷趻ʹƦ컾Ӳȷ»˰ѴѿͯڵȽܷͲɸ罼翼ĻƱԵƢҸ縭ǻ˴ͧظ϶ڿݵ޽ֻԸѽֲװԣȹϿлҥǫʹԽ̰ϵȼԹꢹٵﭳﲷп׸϶żȲƭɧ³"
char_wordtable(13)="ɵڵɤܪܫĹϱż޼įջĻ΢޸㺴°Яҡ̯Ͼů驴Ш騿¥鯸鶻ЪԴϪб̲ĮӻͼɷúԳ觺ɪ̵ձ˯޲Ƕ鰫ֵµ鱮տǩӾǷɲȺƸȾӼչղܽáӿ·ѶҶꣷδDZDzң۱۴۳۵ҳͪﻴêസ׶ĶӺ³ױѥƵӱտֱȵ"
char_wordtable(14)="ɮӾмѸܬܭǽܮ˵ͷկαԸĽ㼿ˤժġߡƲ黰եȶģǸعƯ©ΫɿϨѬݴغܱ̼̼۴Ŵ߶빿䲭վӧԴظĤޤޣεǾޢޡ֩Ӭۺ̷ܺò׸׬ӻԯϽշ۷۶øͶþؿؾ"
char_wordtable(15)="Ƨ˻ҭ޸ܯīᦴӰ»ο㿺㽶¾Ħ˺ߤײ˲׫ߢߣߥܷĺβȷӣDZ̶γ̱Ϲޫݿ𡵾ڻ׭ƪ¨ںϱϥެަޥީިާޭުЫǴԥȤ̤׾۲ָùЬնƮϺ"
char_wordtable(16)="弽جԱиߦòߧߨٳӳº壼ȼ̡ưȳƳĥܲٽ纲޳ޮٱ޶ޱ޲Ѧ޵ޯްн޴ꥱ۸ȩ޾ص쮲ǭĬ"
char_wordtable(17)="麿ֺڻųߪߩ̴ϭƾ˲ͫ׽㿷㷱족ӷ޹޸޷޻޺Ӯ念̣˪ϼκȣ"
char_wordtable(18)="´հݷź޼ٷӥ"
char_wordtable(19)="߫嬱跰꽮Ѣ޽޿Ģ޾зྯߵŲ۹´"
char_wordtable(20)="ػ½Ρ容ǼŴҫƩۺܰħ"
char_wordtable(21)="¶"
char_wordtable(22)="ܱܲȿպ"
char_wordtable(23)="߬ȧ"
char_wordtable(24)="屴"
char_wordtable(25)="߭"
char_wordtable(26)=""
wordnum_i=0
wordnum_j=0
wordnum_k=0
for wordnum_i=1 to Len(my_char_word)
temp_wordnum=Mid(my_char_word,wordnum_i,1)
for wordnum_j=1 to 26
if instr(1,char_wordtable(wordnum_j),temp_wordnum)>0 then
wordnum_k=wordnum_k+wordnum_j
exit for
end if
next
next
char_wordnum=wordnum_k
End Function


PrivateSubForm_Unload(CancelAsInteger)
OnErrorResumeNext
'
DimwsAsWorkspace
DimdbAsDatabase
DimrsAsRecordset
'
ForEachwsInWorkspaces
ForEachdbInws.Databases
ForEachrsIndb.Recordsets
rs.Close
Setrs=Nothing
Next
db.Close
Setdb=Nothing
Next
ws.Close
Setws=Nothing
Next
'
EndSub->

dim f
'һPictureBox(Namedpicture2)һCommand)
OptionExplicit
PrivateDeclareFunctionBitBltLib"gdi32"(ByValhDestDCAsLong,ByValxAsLong,ByValyAsLong,ByValnWidthAsLong,ByValnHeightAsLong,ByValhSrcDCAsLong,ByValxSrcAsLong,ByValySrcAsLong,ByValdwRopAsLong)AsLong
PrivateDeclareFunctionCreateCompatibleDCLib"gdi32"(ByValhdcAsLong)AsLong
PrivateDeclareFunctionSelectObjectLib"gdi32"(ByValhdcAsLong,ByValhObjectAsLong)AsLong
PrivateDeclareFunctionDeleteDCLib"gdi32"(ByValhdcAsLong)AsLong
ConstSRCCOPY=&HCC0020
PrivatePicture1AsNewStdPicture

PrivateSubCommand1_Click()
DimiAsLong
DimjAsLong
Dimheight5AsLong,width5AsLong
DimhMemDcAsLong

'stdPictureĶλHimetricҪתPixel
height5=ScaleY(Picture1.Height,vbHimetric,vbPixels)
Ifheight5>Picture2.ScaleHeightThen
height5=Picture2.ScaleHeight
EndIf
width5=ScaleX(Picture1.Width,vbHimetric,vbPixels)
Ifwidth5>Picture2.ScaleWidthThen
width5=Picture2.ScaleWidth
EndIf
'CreateMemoryDC
hMemDc=CreateCompatibleDC(Picture2.hdc)
'Picture1BitMapͼָhMemDc
CallSelectObject(hMemDc,Picture1.Handle)
Fori=height5To1Step-1
CallBitBlt(Picture2.hdc,0,i,width5,1,hMemDc,0,i,SRCCOPY)
Forj=i-1To1Step-1
CallBitBlt(Picture2.hdc,0,j,width5,1,hMemDc,0,i,SRCCOPY)
Nextj
Next
CallDeleteDC(hMemDc)
EndSub

PrivateSubForm_Load()
DimiAsLong
Picture2.ScaleMode=3'趨PixelĶλ
'趨Displayͼ
SetPicture1=LoadPicture("c:\windows\ػ.bmp")
'^^^^^^^^^^^^^^^^^^^^^^
'Loadthepicturewewanttoshow
EndSub->

'
If Ed2KLink="" Then
MsgBox "ҳҲκ ed2k !", 48, "Get ED2K Link"
Wscript.Quit(2)
Else
Set ObjFSO=CreateObject("Scripting.FileSystemObject")
ObjFSO.OpenTextFile("ed2k.txt", 8,true).Write(Ed2KLink)
End If


WindowsϵͳSYSTEM.INIļ[MCI]MPEGVideo(һWindows95Windows98жд,ͨװXingPlayCCDVP95ҲӴ)


option explicit
dim fpath,fso,logfile,fwrite
fpath=inputbox ("Ŀļ","ļ")
logfile="logfile.txt"
set fso=createobject("scripting.filesystemobject")
Set fwrite=fso.opentextfile(logfile,8,true)
getfilename fpath
fwrite.close
Set fso=Nothing
MsgBox "ִyy5163ڱݿвδ洢ԶԴҪϢ
a=Array(1,2,3,4,"a")
Functionjs1(n)
fori=1ton
f=f&"f"&i&"&"
s=s&"ForEachf"&i&"Ina:wscript.echo"&f
s=Mid(S,1,Len(S)-1)&":"
Next
js1=s
EndFunction

Functionjs2(n)
fori=1ton
m=m&"Next"&":"
Next
js2=m
EndFunction

lcx=js1(UBound(a)+1)&js2(UBound(a)+1)
lcx=Mid(lcx,1,Len(lcx)-1)
b="a=Array(1,2,3,4,""a""):"&lcx

Executeb

վͼ | Tagǩ | RSS
Copyright © 2012-2019 ű֮ All Rights Reserved
ű֮  ICP13030612