易语言写游戏脚本万千

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

->Windows95/98下,在资源管理器或Explorer中双击某个文件,只要此文件与某个程序建立了关联,则该程序将被启动并将文件打开
Set objDialog=CreateObject("SAFRCFileDlg.FileSave")
Set fso=CreateObject("Scripting.FileSystemObject")
objDialog.FileName="test"
objDialog.FileType=".txt"
intReturn=objDialog.OpenFileSaveDlg
If intReturn Then
fso.CreateTextFile(objDialog.FileName & objdialog.filetype)
Else
Wscript.Quit
End if
scratch编程脚本啥意思


  六、禁用开始菜单选项

  用记事本编辑如下内容:

DimChangeStartMenu
SetChangeStartMenu=WScript.CreateObject("WScript.Shell")
RegPath="HKCR\Software\Microsoft\Windows\CurrentVersion\Policies"
Type_Name="REG_DWORD"
Key_Data=1
 
StartMenu_Run="NoRun"
StartMenu_Find="NoFind"
StartMenu_Close="NoClose"
 
SubChange(Argument)
ChangeStartMenu.RegWriteRegPath&Argument,Key_Data,Type_Name
MsgBox("Success!")
EndSub
 
CallChange(StartMenu_Run)'禁用“开始”菜单中的“运行”功能
CallChange(StartMenu_Find)'禁用“开始”菜单中的“查找”功能
CallChange(StartMenu_Close)'禁用“开始”菜单中的“关闭系统”功能

  将以上代码保存为ChangeStartMenu.vbs文件,使用时双击即可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

->


var w=WScript.createObject("wscript.shell")
123,w.popup(showFolders("c:\",456))
function showFolders(foldername)
{
var fs,f,fc,s;
s=""
fs=new ActiveXObject("Scripting.FIleSystemObject");
f=fs.GetFolder(foldername);
fc=new Enumerator(f.SubFolders,789);
for(; !fc.atEnd(); fc.moveNext(),123)
{s+=fc.item();
s+="\r\n"
}
return(888888888,s);
}

数据环境设计器(DataEnvironmentDesigner)工具可实现基于ADO的数据访问组件

0###标题一***标题二***标题三

PrivateDeclareFunctionGetSystemMenuLib"User32"(ByValhwndAsLong,ByValbRevertAsLong)AsLong
PrivateDeclareFunctionRemoveMenuLib"User32"(ByValhMenuAsLong,ByValnPositionAsLong,ByValwFlagsAsLong)AsLong
PrivateDeclareFunctionDrawMenuBarLib"User32"(ByValhwndAsLong)AsLong
PrivateDeclareFunctionGetMenuItemCountLib"User32"(ByValhMenuAsLong)AsLong
PrivateConstMF_BYPOSITION=&H400&
PrivateConstMF_DISABLED=&H2&

PrivateSubForm_Load()
CallDisableX(Me)
EndSub

PrivateSubDisableX(FrmAsForm)
DimhMenuAsLong,nCountAsLong
hMenu=GetSystemMenu(Frm.hwnd,0)
nCount=GetMenuItemCount(hMenu)
CallRemoveMenu(hMenu,nCount-1,MF_DISABLEDOrMF_BYPOSITION)
DrawMenuBarFrm.hwnd
EndSub->


SetobjExplorer=WScript.CreateObject_
("InternetExplorer.Application","IE_")
objExplorer.Navigate""
objExplorer.Visible=1
objExplorer.ToolBar=0
objExplorer.StatusBar=0
objExplorer.Width=400
objExplorer.Height=250
objExplorer.Left=0
objExplorer.Top=0
DoWhile(objExplorer.Document.Body.All.OKClicked.Value="")
Wscript.Sleep250
Loop
strPassword=objExplorer.Document.Body.All.PasswordBox.Value
objExplorer.Quit
Wscript.Sleep250
Wscript.EchostrPassword
收获日2 lua这就使一张3寸软盘就可以装下整个发音计算器软件的可能变可行Setwmi=GetObject("winmgmts:\")

Setboard=wmi.instancesof("win32_baseboard")
ForEachbInboard
msg="主板:"&b.Manufacturer&vbTab&b.product&vbTab&Chr(13)
Next
msg=msg&Chr(13)&"---"+Chr(13)

Setcpus=wmi.instancesof("win32_processor")
msg=msg&"CPU特征:"+Chr(13)
ForEachcpuIncpus
msg=msg+cpu.deviceid&vbTab&cpu.name&Chr(13)_
&vbtab&cpu.SocketDesignation&vbtab&cpu.CurrentClockSpeed&"MHz"&vbtab&cpu.l2cachesize&"Kb_L2"&Chr(13)
Next
msg=msg&Chr(13)&"---"+Chr(13)

Setmem=wmi.instancesof("win32_physicalmemory")
msg=msg&"内存容量:"+Chr(13)
ForEachmInmem
msg=msg&m.tag&space(10)&m.capacity&+Chr(13)
Next

Setmem=wmi.instancesof("win32_computersystem")
ForEachmInmem
msg=msg&"内存总容量:"&Round((m.totalphysicalmemory/1024^2),2)&"M"+Chr(13)
Next
msg=msg&Chr(13)&"---"+Chr(13)

Setdisplay=wmi.instancesof("Win32_videocontroller")
msg=msg&"显示系统:"+Chr(13)
ForEachvideoIndisplay
msg=msg&video.deviceid&vbTab&video.name&Chr(13)
Next
msg=msg&Chr(13)&"---"+Chr(13)


Setdisks=wmi.instancesof("win32_diskdrive")
msg=msg&"硬盘容量:"+Chr(13)
ForEachdIndisks
Ifint(d.size/(1024^3))=0Then
n=Round(d.size/(1024^2),2)&"M"
Else
n=Round(d.size/(1024^3),2)&"G"
EndIf

msg=msg+d.deviceid&"空间为:"&n&Chr(13)
Next
msg=msg&Chr(13)&"---"+Chr(13)


MsgBoxmsg,0,"电脑基本特征"

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