Home aSocks Sample File: WhoIs/WhoIs.prg
Sample Application Files
Encode:
  • Encode.prg
  • Finger:
  • Finger.prg
  • HTTP:
  • HTTPGrabContentGUI.prg
  • HTTPHeaderCRT.prg
  • HTTPHeaderGUI.prg
  • HTTPLinkListCRT.prg
  • HTTPRequestCRT.prg
  • SSL_POST.prg
  • RawWrite.prg
  • MIME:
  • MIME_Dlg.prg
  • NNTP:
  • NewsCheckCRT.prg
  • NewsCheckGUI.prg
  • SMTP:
  • CommandLineMailer.prg
  • SendMail.prg
  • SendMailGUI.prg
  • Telnet:
  • TelnetDemo.prg
  • TelnetGUI.prg
  • Time:
  • GrabTime.prg
  • TimeZoneCRT.prg
  • TimeZoneGUI.prg
  • WhoIs:
  • WhoIs.prg
  • //********************************************************
    //   Project: ASocks Library - WhoIs Sample Application
    //********************************************************
    //    Author: Michael Mc Vicker
    // Copyright: © 05/21/02 - All Rights Reserved
    //  FileName: WhoIs.prg
    //
    // Updates:
    //  Last Update: 05/21/02 by MMM
    //
    // Notes:
    //
    //********************************************************
    
    #Include "CSKEYS.ch"
    #Include "ASocksKey.ch"
    
    //*******************************
    Procedure DBESys ( )
    Return
    
    //*******************************
    Procedure Main ( )
    //*******************************
      Local cDomain := space(50), cResults := ""
      @ 0, 0 Clear
      @ 0, 0 say "Enter Domain to search for: " Get cDomain
      Read
      If Lastkey() != 27 // [Esc]
        cResults := GetInfo(Trim(cDomain))
        @ 24, 0 say "Press [Esc] to continue"
        MemoEdit( cResults,0,0,22,79,.F.)
      EndIF
    Return
    
    
    //*******************************
    Function GetInfo ( cDomain )
    //*******************************
      Local xRet := "", oWhoIs
      oWhoIs := aprWhoIs():New(ASOCKS_LICENSE_KEY,CSTOOLS_LICENSE_KEY)
      oWhoIs:Connect("whois.opensrs.net",,2) > 0
      // Alternate Registrar
      // oWhoIs:Connect("whois.networksolutions.com",,2)
      If oWhoIs:Search(cDomain)
        xRet := oWhoIs:Read()
      Else
        xRet := oWhoIs:cErr
      EndIf
      oWhoIs:Disconnect()
      oWhoIs:Destroy()
    Return xRet