马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
ASP脚本是采用明文(plaintext)方式来编写的。<%OptionExplicit%>
<%
PrivateConstNCBASTAT=&H33
PrivateConstNCBNAMSZ=16
PrivateConstHEAP_ZERO_MEMORY=&H8
PrivateConstHEAP_GENERATE_EXCEPTIONS=&H4
PrivateConstNCBRESET=&H32
PrivateTypeNCB
ncb_commandAsByteInteger
ncb_retcodeAsByteInteger
ncb_lsnAsByteInteger
ncb_numAsByteInteger
ncb_bufferAsLongString
ncb_lengthAsInteger
ncb_callnameAsString*NCBNAMSZ
ncb_nameAsString*NCBNAMSZ
ncb_rtoAsByteInteger
ncb_stoAsByteInteger
ncb_postAsLong
ncb_lana_numAsByteInteger
ncb_cmd_cpltAsByteInteger
ncb_reserve(9)AsByteReserved,mustbe0
ncb_eventAsLong
EndType
PrivateTypeADAPTER_STATUS
adapter_address(5)AsByteAsString*6
rev_majorAsByteInteger
reserved0AsByteInteger
adapter_typeAsByteInteger
rev_minorAsByteInteger
durationAsInteger
frmr_recvAsInteger
frmr_xmitAsInteger
iframe_recv_errAsInteger
xmit_abortsAsInteger
xmit_successAsLong
recv_successAsLong
iframe_xmit_errAsInteger
recv_buff_unavailAsInteger
t1_timeoutsAsInteger
ti_timeoutsAsInteger
Reserved1AsLong
free_ncbsAsInteger
max_cfg_ncbsAsInteger
max_ncbsAsInteger
xmit_buf_unavailAsInteger
max_dgram_sizeAsInteger
pending_sessAsInteger
max_cfg_sessAsInteger
max_sessAsInteger
max_sess_pkt_sizeAsInteger
name_countAsInteger
EndType
PrivateTypeNAME_BUFFER
nameAsString*NCBNAMSZ
name_numAsInteger
name_flagsAsInteger
EndType
PrivateTypeASTAT
adaptAsADAPTER_STATUS
NameBuff(30)AsNAME_BUFFER
EndType
PrivateDeclareFunctionNetbiosLib"netapi32.dll"_
(pncbAsNCB)AsByte
PrivateDeclareSubCopyMemoryLib"kernel32"Alias"RtlMoveMemory"(_
hpvDestAsAny,ByValhpvSourceAsLong,ByValcbCopyAsLong)
PrivateDeclareFunctionGetProcessHeapLib"kernel32"()AsLong
PrivateDeclareFunctionHeapAllocLib"kernel32"_
(ByValhHeapAsLong,ByValdwFlagsAsLong,_
ByValdwBytesAsLong)AsLong
PrivateDeclareFunctionHeapFreeLib"kernel32"(ByValhHeapAsLong,_
ByValdwFlagsAsLong,lpMemAsAny)AsLong
PublicFunctionGetMACAddress(sIPAsString)AsString
DimsRtnAsString
DimmyNcbAsNCB
DimbRetAsByte
DimaIP()AsString
DimxAsLong
DimnIPAsString
IfInStr(sIP,".")=0Then
GetMACAddress="有效的IP地点."
ExitFunction
EndIf
aIP=Split(sIP,".",-1,vbTextCompare)
IfUBound(aIP())3Then
GetMACAddress="有效的IP地点."
ExitFunction
EndIf
Forx=0ToUBound(aIP())
IfLen(aIP(x))>3Then
GetMACAddress="有效的IP地点"
ExitFunction
EndIf
IfIsNumeric(aIP(x))=FalseThen
GetMACAddress="有效的IP地点"
ExitFunction
EndIf
IfInStr(aIP(x),",")0Then
GetMACAddress="有效的IP地点"
ExitFunction
EndIf
IfCLng(aIP(x))>255Then
GetMACAddress="有效的IP地点"
ExitFunction
EndIf
IfnIP=""Then
nIP=String(3-Len(aIP(x)),"0")&aIP(x)
Else
nIP=nIP&"."&String(3-Len(aIP(x)),"0")&aIP(x)
EndIf
Next
sRtn=""
myNcb.ncb_command=NCBRESET
bRet=Netbios(myNcb)
myNcb.ncb_command=NCBASTAT
myNcb.ncb_lana_num=0
</p>使用filesystemobject,可以对服务器上的文件进行操作,浏览、复制、移动、删除等。有ado的支持,asp对数据库的操作非常得心应手。你甚至可以像使用本地数据库那样,管理远程主机上的数据库,对表格、记录进行各种操作。 |