Quantcast
Channel: VBForums - ASP, VB Script
Viewing all articles
Browse latest Browse all 688

Script Error: Source: Microsoft VBScript runtime error - Error: 800A000D

$
0
0
Hello,

New to the forum. I'm trying to set up a script that blocks country by code for my email server. Here is the code:

Code:

Sub OnClientConnect(oClient)

  Const BlackList="AR VN CN AF AL DZ AM AU AT AZ BS BH BD BY BE BA BZ BG KH CA CF TD CL CO CG CD HR CU CZ DK DO EC EG EE ET FR GE DE GH GI GR IN ID IR IQ IE IL IT JP JO KZ KP KE KW KG LA LV LB LR LY MY MV ML MT MX MA PS OM QA RU SA SG SY TW TM AE UZ YE"
     
  Dim IP, Port, locationRaw, locationArray, s, regExp, CountryCode
  Const chr34="\"""
  Const Accept=0
  Const Deny=1

  '--- Get IP:port...     
  IP = oClient.IPAddress
  Port = oClient.Port

  '--- Exclude local IP addressess...     
  if InStr(IP,"127.")<>1 and InStr(IP,"10.")<>1 then

  '--- Prepare regular expression...
      Set regEx = New RegExp
      '--- Search for first `"geobytesinternet":"AA"` occurence...
      regEx.Pattern=chr34 & "geobytesinternet" & chr34 & "\:" & chr34 & "[A-Z]{2}" & chr34
      '--- Match case...
      regEx.IgnoreCase = False 
      '--- First match only...
      regEx.Global = False 
     
  '--- Get GeoIP information...     
      Set locationRaw = CreateObject("MSXML2.XMLHTTP")
      locationRaw.open "GET", "http://getcitydetails.geobytes.com/GetCityDetails?fqcn=" & trim(oClient.IPaddress), False
      locationRaw.send     
       
  '--- Search for CountryCode...
      Set Matches = regEx.Execute(locationRaw.responseText)
      '--- If found then set CountryCode...
      if Matches.Count=1 then CountryCode=mid(Matches(0).value,21,2) else CountryCode="??"
      Call WriteLogfile("onClientConnect: " & IP & ", " & Port & ", " & CountryCode)
     
  '--- Check for blacklisted country and if so, log it and abort session...
      If InStr(Blacklist,CountryCode)<>0 then
        EventLog.Write(now() & "Blacklisted: " & IP & ", " & CountryCode)
        Result.Value=Deny
      end if             
  End If
       
End Sub

I'm getting the error
Quote:

Script Error: Source: Microsoft VBScript runtime error - Error: 800A000D - Description: Type mismatch: 'WriteLogfile' - Line: 35 Column: 6 - Code: (null)
I'm not savvy with vbscript and was wondering if someone may know why I get this error?

Thanks in advance!

Viewing all articles
Browse latest Browse all 688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>