虚拟主机域名注册-常见问题虚拟主机问题 → 虚拟主机问题


用asp检查一个域名的备案状态的例子!
作者:
<%
'程序功能,自动到信产部网站核对一个域名的备案情况,如果备案成功,返回备案编号。

ICPCheckURL=1
Dim DataSet_ICP()

function GetsRoot(ByVal whichDomain)
 whichDomain=Lcase(whichDomain)
 Exts=".bj.cn,.sh.cn,.tj.cn,.cq.cn,.he.cn,.sx.cn,.nm.cn,.ln.cn,.jl.cn,.hl.cn,.js.cn,.zj.cn,.ah.cn,.fj.cn,.jx.cn,.sd.cn,.ha.cn,.hb.cn,.hn.cn,.gd.cn,.gx.cn,.hi.cn,."
Exts=Exts&"sc.cn,.gz.cn,.yn.cn,.xz.cn,.sn.cn,.gs.cn,.qh.cn,.nx.cn,.xj.cn,.tw.cn,.hk.cn,.mo.cn,"
 Exts= Exts & ".ac.cn,.com.cn,.net.cn,.org.cn,.gov.cn,.edu.cn,.com,.net,.org,.biz,.cn,.info,.tv,.cc,.tw,.name,.ws,.in,.hk,.tw,.us,.au,.ac,.ca"
 AllTop=split(Exts,",")
 if len(whichDomain)>3 then
  for z=0 to Ubound(AllTop)
   extLen=len(AllTop(z))
   if right(whichDomain,extLen)=AllTop(z) then
    prefix=left(whichDomain,len(whichDomain)-extLen)
    dotPos=inStrRev(prefix,".")
    if dotPos>0 then
     whichDomain=mid(prefix,dotPos+1) & AllTop(z)
    end if
    exit for
   end if
  next
 end if
 GetsRoot=whichDomain
end function


function getCmd(strM)
 strM=lcase(strM)
 if inStr(strM," ")>0 then
  getCmd=left(strM,inStr(strM," ")-1)
 else
  getCmd=strM
 end if
end function

Function bstr(vIn)

 Dim strReturn,iii,ThisCharCode,innerCode,Hight8,Low8,NextCharCode
 strReturn = ""
 
 For iii = 1 To LenB(vIn)
  ThisCharCode = AscB(MidB(vIn,iii,1))
  If ThisCharCode < &H80 Then
   strReturn = strReturn & Chr(ThisCharCode)
  Else
   NextCharCode = AscB(MidB(vIn,iii+1,1))
   strReturn = strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt(NextCharCode))
   iii = iii + 1
  End If
 Next
 bstr = strReturn  
End Function

Sub tinyFitler(someMes)
 ReDim Preserve DataSet_ICP(0)
 blDrop=true
 blN=false
 PreChar=""
 PreCmd=""
 blInTd=false
 intTB=0
 intTR=0
 intTD=0
 blInTd=false
 infos=""

 for iii=1 to len(someMes)
  Schar=mid(someMes,iii,1)
  if Schar="<" then
  blDrop=true
  lastCmd=""
  blN=false
  elseif Schar=">" then
  blDrop=false '某个命令完成
  lastCmd=getCmd(lastCmd)
  if blN then
    if lastCmd="a" then
     if blInTd then infos=infos & ","
    end if
    if lastCmd="td" then
     blInTD=false
     DataSet_ICP(intTR)=DataSet_ICP(intTR) & infos & "`"
     infos=""
    end if
  else
    if lastCmd="table" then
     intTB=intTB+1
      if intTB>1 then
       Exit Sub '不用处理余下的表格
      end if
    end if
    if lastCmd="tr" then
     intTR=intTR+1
     intTD=0
     blInTD=false
     ReDim Preserve DataSet_ICP(intTR)
    end if
 
    if lastCmd="td" then
     blInTD=true
     intTD=intTD+1
    end if
    
  end if

  elseif Schar="/" and PreChar="<" then
  blN=true
  else
   if not blDrop then
    if blInTD then infos=infos & Schar
   else
    lastCmd=lastCmd & Schar
   end if
  end if
  PreChar=Schar
 next

end Sub
'程序设计:西部数码(http://www.west263.com )专业提供虚拟主机、域名注册

Function GetICP(ByType,textvalue)
 on error resume next

 if ByType="No" then
  Gtype=8
 else
  Gtype=2
 end if
'---type=6根据url查询(URL);type=2,根据域名查询(DO),type=8,根据icp编号来查(No)

 if ByType="URL" then
  Gtype=6
 end if

 Referer="http://www.miibeian.gov.cn/Search/WW_ICP_WhetherRecord_Select.jsp";
 if ICPCheckURL="1" then
  url="http://211.94.161.10/Search/WW_ICP_WhetherRecord_Search.jsp?selectid="; & Gtype & "&textfield=" & textvalue
 elseif ICPCheckURL="2" then
  url="http://www.miibeian.gov.cn/Search/WW_ICP_WhetherRecord_Search.jsp?selectid="; & Gtype & "&textfield=" & textvalue
 end if


Set Retrieval = Server.CreateObject("Microsoft.XMLHTTP")
With Retrieval
.Open "Post", url, false
   .setRequestHeader "Referer",Referer
.Send
   GetICP =.ResponseBody
   End With
Set Retrieval = Nothing
 GetICP=bstr(GetICP)
End Function


'如果要检查,必须先LoadICP
Function LoadICP(BYWHICH,GIVE)
 RetCode=GetICP(BYWHICH,GIVE)
 if isNull(RetCode) then
  LoadICP=false
 else
  Call tinyFitler(RetCode)
  LoadICP=true
 end if
end Function

Function GetNo()
 RRsets=Ubound(DataSet_ICP)
 if RRsets=0 then
  GetNo="ERROR"
 end if
 if RRsets=1 then
  GetNo="NONE"
 end if
 if RRsets>1 then
  GetNo=split(DataSet_ICP(2),"`")(3)
 end if 
end Function


ckbind="要检查的域名.com"
 If LoadICP("DO",ckbind) Then
   IcpNO=GetNo()
   If IcpNo="NONE" Or IcpNo="ERROR" Then
    if LoadICP("URL",ckbind) then
     IcpNO=GetNo() 
    end if
   End If 'GetsRoot


   If IcpNo="NONE" Or IcpNo="ERROR" Then
    if LoadICP("DO",GetsRoot(ckbind)) then
     IcpNO=GetNo() 
    end if
   End If

   If IcpNo="NONE" Or IcpNo="ERROR" Then
    if LoadICP("URL",GetsRoot(ckbind)) then
     IcpNO=GetNo() 
    end if
   End If
  
   if IcpNo="NONE" or IcpNo="ERROR" then
   respnose.write  "该域名还未备案成功!"
   else
   respnose.write  "该域名已经备案成功!备案编号是:"&IcpNO
   end if

 End If


%>

<% '程序功能,自动到信产部网站核对一个域名的备案情况,如果备案成功,返回备案编号。 ICPCheckURL=1 Dim DataSet_ICP() function GetsRoot(ByVal whichDomain) whichDomain=Lcase(whichDomain) Exts=".bj.cn,.sh.cn,.tj.cn,.cq.cn,.he.cn,.sx.cn,.nm.cn,.ln.cn,.jl.cn,.hl.cn,.js.cn,.zj.cn,.ah.cn,.fj.cn,.jx.cn,.sd.cn,.ha.cn,.hb.cn,.hn.cn,.gd.cn,.gx.cn,.hi.cn,." Exts=Exts&"sc.cn,.gz.cn,.yn.cn,.xz.cn,.sn.cn,.gs.cn,.qh.cn,.nx.cn,.xj.cn,.tw.cn,.hk.cn,.mo.cn," Exts= Exts & ".ac.cn,.com.cn,.net.cn,.org.cn,.gov.cn,.edu.cn,.com,.net,.org,.biz,.cn,.info,.tv,.cc,.tw,.name,.ws,.in,.hk,.tw,.us,.au,.ac,.ca" AllTop=split(Exts,",") if len(whichDomain)>3 then for z=0 to Ubound(AllTop) extLen=len(AllTop(z)) if right(whichDomain,extLen)=AllTop(z) then prefix=left(whichDomain,len(whichDomain)-extLen) dotPos=inStrRev(prefix,".") if dotPos>0 then whichDomain=mid(prefix,dotPos+1) & AllTop(z) end if exit for end if next end if GetsRoot=whichDomain end function function getCmd(strM) strM=lcase(strM) if inStr(strM," ")>0 then getCmd=left(strM,inStr(strM," ")-1) else getCmd=strM end if end function Function bstr(vIn) Dim strReturn,iii,ThisCharCode,innerCode,Hight8,Low8,NextCharCode strReturn = "" For iii = 1 To LenB(vIn) ThisCharCode = AscB(MidB(vIn,iii,1)) If ThisCharCode < &H80 Then strReturn = strReturn & Chr(ThisCharCode) Else NextCharCode = AscB(MidB(vIn,iii+1,1)) strReturn = strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt(NextCharCode)) iii = iii + 1 End If Next bstr = strReturn End Function Sub tinyFitler(someMes) ReDim Preserve DataSet_ICP(0) blDrop=true blN=false PreChar="" PreCmd="" blInTd=false intTB=0 intTR=0 intTD=0 blInTd=false infos="" for iii=1 to len(someMes) Schar=mid(someMes,iii,1) if Schar="<" then blDrop=true lastCmd="" blN=false elseif Schar=">" then blDrop=false '某个命令完成 lastCmd=getCmd(lastCmd) if blN then if lastCmd="a" then if blInTd then infos=infos & "," end if if lastCmd="td" then blInTD=false DataSet_ICP(intTR)=DataSet_ICP(intTR) & infos & "`" infos="" end if else if lastCmd="table" then intTB=intTB+1 if intTB>1 then Exit Sub '不用处理余下的表格 end if end if if lastCmd="tr" then intTR=intTR+1 intTD=0 blInTD=false ReDim Preserve DataSet_ICP(intTR) end if if lastCmd="td" then blInTD=true intTD=intTD+1 end if end if elseif Schar="/" and PreChar="<" then blN=true else if not blDrop then if blInTD then infos=infos & Schar else lastCmd=lastCmd & Schar end if end if PreChar=Schar next end Sub '程序设计:西部数码(http://www.west263.com )专业提供虚拟主机、域名注册 Function GetICP(ByType,textValue) on error resume next if ByType="No" then Gtype=8 else Gtype=2 end if '---type=6根据url查询(URL);type=2,根据域名查询(DO),type=8,根据icp编号来查(No) if ByType="URL" then Gtype=6 end if Referer="http://www.miibeian.gov.cn/Search/WW_ICP_WhetherRecord_Select.jsp" if ICPCheckURL="1" then url="http://211.94.161.10/Search/WW_ICP_WhetherRecord_Search.jsp?selectid=" & Gtype & "&textfield=" & textValue elseif ICPCheckURL="2" then url="http://www.miibeian.gov.cn/Search/WW_ICP_WhetherRecord_Search.jsp?selectid=" & Gtype & "&textfield=" & textValue end if Set Retrieval = Server.CreateObject("Microsoft.XMLHTTP") With Retrieval .Open "Post", url, false .setRequestHeader "Referer",Referer .Send GetICP =.ResponseBody End With Set Retrieval = Nothing GetICP=bstr(GetICP) End Function '如果要检查,必须先LoadICP Function LoadICP(BYWHICH,GIVE) RetCode=GetICP(BYWHICH,GIVE) if isNull(RetCode) then LoadICP=false else Call tinyFitler(RetCode) LoadICP=true end if end Function Function GetNo() RRsets=Ubound(DataSet_ICP) if RRsets=0 then GetNo="ERROR" end if if RRsets=1 then GetNo="NONE" end if if RRsets>1 then GetNo=split(DataSet_ICP(2),"`")(3) end if end Function ckbind="要检查的域名.com" If LoadICP("DO",ckbind) Then IcpNO=GetNo() If IcpNo="NONE" Or IcpNo="ERROR" Then if LoadICP("URL",ckbind) then IcpNO=GetNo() end if End If 'GetsRoot If IcpNo="NONE" Or IcpNo="ERROR" Then if LoadICP("DO",GetsRoot(ckbind)) then IcpNO=GetNo() end if End If If IcpNo="NONE" Or IcpNo="ERROR" Then if LoadICP("URL",GetsRoot(ckbind)) then IcpNO=GetNo() end if End If if IcpNo="NONE" or IcpNo="ERROR" then respnose.write "该域名还未备案成功!" else respnose.write "该域名已经备案成功!备案编号是:"&IcpNO end if End If %>


来源:
阅读:38057
日期:2006-12-12

【 双击滚屏 】 【 推荐朋友 】 【 收藏 】 【 打印 】 【 关闭 】 【 字体: 】 
上一篇:用PHP在线发送邮件的例子!
下一篇:异地汇款手续费费率
  >> 相关文章
 
闂傚倸鍊峰ù鍥敋瑜庨〃銉╁传閵壯傜瑝閻庡箍鍎遍ˇ顖炲垂閸屾稓绠剧€瑰壊鍠曠花濠氭煛閸曗晛鍔滅紒缁樼洴楠炲鎮欓崹顐㈡珝濠电偛鐡ㄧ划宥囧垝閹捐钃熸繛鎴欏灪閺呮粓鎮归崶銊ョ祷缂佺姾娅g槐鎾存媴閻熸澘顫嶅銈冨妼閻楀繐危閹版澘绠虫俊銈勭娴滃ジ姊洪崨濠佺繁闁搞劍濞婇弫宥夋偄閸忓皷鎷洪柣鐘叉礌閳ь剝娅曢悘鍫ユ⒑閹稿孩绌跨紒鐘虫尭閻g兘鎮╃拠鎻掑敤濡炪倖鎸鹃崰搴♀枔閵夆晜鈷戦梻鍫熺〒婢ф洘绻涚仦鍌氣偓婵嬪箖閿熺姵鏅搁柨鐕傛嫹闂傚倸鍊搁崐鐑芥嚄閼哥數浠氭繝鐢靛仜閻°劌鐣濈粙璺ㄦ殾婵犲﹤鍟犻弸搴ㄧ叓閸ラ鍒版繛鍫亰濮婃椽宕ㄦ繝鍌毿曢梺鍝ュУ閻楁洟顢欒箛鎾斀闁搞儻濡囩粻姘渻閵堝棛澧紒璇插暣婵℃挳宕橀鍡欙紲婵℃彃鏈悧妤呮倶閸溿儳绱撻崒姘偓鎼佸磹妞嬪孩顐介柨鐔哄Т閸ㄥ倿姊婚崼鐔恒€掗柡鍡畵閺岋綁濮€閵堝棙閿梺鎼炲妽缁诲牓寮婚妸鈺傚亞闁稿本绋戦锟�闂傚倸鍊搁崐椋庢濮橆兗缂氶柤濮愬€栫€氬鏌i弮鍌氬付缂佲偓婢舵劕绠规繛锝庡墮婵″ジ鏌涘顒傜Ш妤犵偞鐗楀ḿ蹇涘礈瑜忚摫濠电姵顔栭崹浼村Χ閹间礁钃熼柡鍥风磿閻も偓闂侀潧锛忛崘銊у帓闂傚倷绀侀幖顐︻敄閸ャ劍鍙忛柟缁㈠枟缁犳帗绻濋悽闈涱潚闁告侗鍘滈姀銈嗙厱闁绘洑绀侀悘锔筋殽閻愬弶顥㈤柡浣规崌閺佹捇鏁撻敓锟�婵犵數濮烽弫鎼佸磻濞戙垺鍋ら柕濞у啫鐏婇柟鍏肩暘閸斿瞼澹曢崸妤佺厪闁割偅绻冮ˉ鐐寸箾閸涱垰鈻堥柡宀嬬到铻f繛鍡樺劤濞堫厾绱撴担鍝勵€岄柛銊ㄤ含閹广垹鈽夐姀鐘殿吅闂佺粯鍔楅弫鎼佹倿閼测晝纾藉〒姘搐濞呮瑩鏌熼崙銈嗗闂傚倷娴囬褍霉閻戣棄鏋佸┑鐘宠壘绾捐鈹戦悩鍙夋悙缂佹劖顨婇弻锟犲炊閳轰焦鐏侀梺宕囨嚀缁夋挳鍩為幋锔藉亹闁告瑥顦伴幃娆戠磽娴f彃浜鹃梺绋挎湰缁嬪繑绂嶅⿰鍫熺厵閺夊牆澧界粙鑽ょ棯椤撶偟鍩i柡灞诲€曢~銏犵暆婵犲啰绉锋俊鐐€戦崝濠囧磿閻㈢ǹ绠栨繛鍡樻尭缁犵敻鏌熼悜妯诲鞍闁伙讣缍侀弻锝夋偄閸濄儳鐓傛繝鈷€鍕垫當瀹€锝呯仢閳诲酣骞欓崘鈺傛珨闂備焦瀵х换鍌炈囬鐐村€块柛顭戝亖娴滄粓鏌熼悜妯虹仴妞ゅ繆鏅犻弻锝夘敇閻曚焦鐤侀梺鍝勮閸旀垿骞冮妶澶婄<婵炴垶锕╂导锟�闂傚倷娴囬褍霉閻戣棄鏋佸┑鐘宠壘绾捐鈹戦悩鍙夋悙缂佹劖顨婇弻锟犲炊閳轰焦鐏侀梺宕囨嚀缁夋挳鍩為幋锔藉亹闁告瑥顦伴幃娆撴⒑濮瑰洤鈧倝宕抽敐澶婅摕闁靛ň鏅滈崑鍡涙煕鐏炲墽鈽夋い蹇ユ嫹闂傚倸鍊搁崐椋庣矆娓氣偓楠炴牠顢曢埛姘そ婵¤埖寰勭€n亙妲愰梻渚€娼ц墝闁哄懏鐩幏鎴︽偄閸忚偐鍙嗛梺缁樻礀閸婂湱鈧熬鎷�缂傚倸鍊搁崐鎼佸磹閹间礁纾归柟闂寸閻ゎ喗銇勯弽顐粶闁搞劌鍊婚幉鎼佹偋閸繄鐟查梺绋款儑閸犳劙濡甸崟顖氬唨妞ゆ劦婢€缁墎绱撴担鎻掍壕闂佺硶鍓濈粙鎺楁偂濞戙垺鐓曟い鎰Т閻忣亪鏌¢崱蹇旀珖缂佽鲸甯為埀顒婄秬閸╂牜鈧熬鎷�缂傚倸鍊搁崐鎼佸磹閹间礁纾归柟闂寸閻ゎ喗銇勯弽顐粶闁搞劌鍊婚幉鎼佹偋閸繄鐟查梺绋款儑閸犳劙濡甸崟顖氬唨闁靛ě鍛帓闂備焦妞块崢鐣屽枈瀹ュ洦宕叉繛鎴烇供閸熷懏銇勯弮鍥у惞闁告垵缍婂娲箰鎼达絻鈧帡鏌涢悩宕囧⒌鐎殿喖顭烽弫鎾绘偐閺屻儱鏁规繝鐢靛█濞佳囨偄閸℃稑顫呴柣姗嗗亝閺傗偓婵$偑鍊栧褰掑磿閹惰棄鍑犳繛鎴炲焹閸嬫挾鎲撮崟顒傤槰婵犵數鍋涢敃顏勵嚕椤愶箑绠荤紓浣股戝▍銏ゆ⒑鐠恒劌娅愰柟鍑ゆ嫹闂傚倸鍊搁崐鐑芥嚄閸撲焦鍏滈柛顐f礀閻ょ偓绻濋棃娑卞剰缂佹劖顨婇獮鏍庨鈧俊鑲╃磼閻樺磭澧甸柡宀嬬節瀹曞爼鍩℃担閿嬬潖闂備礁鎼鍡涙偋閻樿钃熼柡鍥╁枔缁犻箖鏌涢…鎴濇灈濠殿喖閰e娲传閸曨偀鍋撻悽绋跨;闁跨噦鎷�闂傚倷娴囬褍霉閻戣棄鏋佸┑鐘宠壘绾捐鈹戦悩鍙夋悙缂佹劖顨婇弻锟犲炊閳轰絿锝嗐亜椤愶絾绀嬮柡宀€鍠栭幃婊兾熼悜鈺傚闂備焦妞块崢浠嬪箲閸ヮ剙钃熺€广儱鐗滃顏堟⒑閻熸澘娈╅柟鍑ゆ嫹.闂傚倸鍊搁崐椋庣矆娓氣偓楠炲鏁嶉崟顒€搴婇梺閫炲苯澧撮柡灞诲€楅埀顒€婀辨慨鎾偂閹扮増鐓涢柛娑氬绾箖鏌嶇憴鍕伌鐎规洜鍘чオ浼村礋椤愩埄鈧繘姊婚崒娆愮グ婵炲娲熷畷鎶芥晝閸屾氨顔嗛梺璺ㄥ櫐閹凤拷闂傚倸鍊搁崐椋庣矆娓氣偓楠炲鍨鹃幇浣圭稁婵犵數濮甸懝鍓у缂佹ḿ绠鹃柟瀛樼懃閻忊晠鏌i鐕佹疁闁哄被鍔戦幃銈夊磼濞戞﹩浼�:0898-31568060婵犵數濮烽弫鎼佸磻閻愬搫鍨傞柛顐f礀缁犳澘鈹戦悩瀹犲缂佺姵婢樿灃闁挎繂鎳庨弳娆撴煕濮橆剛绉洪柡灞诲姂閹倝宕掑☉姗嗕紦:13807590485