[Gambas-user] Obtain my IP with Gambas

PICCORO McKAY Lenz mckaygerhard at ...626...
Mon Oct 28 16:47:32 CET 2013


I try to recover my local ip from network, and tryng this code, why
skip the dialog?:

Public Sub btnenviocentral_Click()
    Dim ipaddr As Integer = 2
    fauth = New FAuth
    If fauth.ShowModal() Or Not fauth.inputcodigo Then ' if nothinhg
was input cancel an try again
        Return
    Else
        Shell "/sbin/ifconfig| grep -w 'inet addr' | grep -v
'127.0.0.1' | cut -d: -f2| awk '{print $1}' " To ipaddr
        Print ipaddr
        If Comp(fauth.inputcodigo, "1234", gb.IgnoreCase) == 0 Then
            Message.Info("ip: '" & ipaddr & "'")
        Else
            Message.Error("worng passd.")
            Return
        Endif
    Endif
    Catch
End

when executed, and imput code are same as "1234", dont print and skip
lines follow

The root account its the only that have access to ifconfig command by
security issues.. so must try using full path...



-- 
Lenz McKAY Gerardo (PICCORO)
http://qgqlochekone.blogspot.com




More information about the User mailing list