' Ip_Message.bas for RapidQ
' Coded by Gérald VERDIER - BinoclaR (°-°) software
' december 2003
' email : gerald.verdier@club-internet.fr
' PURPOSE : very short program - no form only showmessage for ip and name
declare sub infoS
Dim s as QSocket

DIM SockNum AS INTEGER
    SockNum = 0
    
CREATE Form AS QFORM
    borderstyle = 0
    Center
    OnShow = InfoS
    create label as QLabel
    end create
END CREATE
' -------------------------------------------------------------------
sub infoS
    Ip$ = s.GetHostIP           'get your own machine IP address
    Name$ = s.GetHostName       'get the user computer name
    s.Open(80)
    SockNum = S.Connect(name$, 80)
    ShowMessage "Name : "+ Name$ + chr$(13) + "IP : "+ip$ 
Showmessage str$(SockNum)
     If SockNum > 0 THEN
         ShowMessage "Name : "+ Name$ + chr$(13) + "IP : "+ip$ 
         s.Close(SockNum)
     end if          
end sub

Form.Show
