[Gambas-user] Need Help IP Address
Alex Schaller
gambas at ...1077...
Sat Aug 20 09:34:01 CEST 2005
Hello Ignatius,
You can use the following code to get all the information about your Ethernet
Cards.
You have to use one of the newer Gambas Development versions. I was using
1.9.16. The syntax of the SHELL command changed.
You have to put a Button and a textarea on the form and paste the code below
in the module.
Hope this helps.
Alex
' Gambas class file
PRIVATE myProcess AS Process
PRIVATE sResult AS String
PUBLIC SUB Button1_Click()
DIM sExeString AS String
DIM icnt AS Integer
textarea1.Clear
FOR icnt = 0 TO 4
sExeString = "/sbin/ifconfig eth" & icnt
textarea1.Text = textarea1.Text & "--------eth-" & icnt & "--------" &
gb.NewLine
myProcess = SHELL sExeString WAIT FOR READ
NEXT
END
PUBLIC SUB Process_Error(sData AS String)
'Here you can add some error code
END
PUBLIC SUB Process_Read()
DIM sLine AS String
LINE INPUT #LAST, sLine
textarea1.Text = textarea1.Text & sLine & gb.NewLine
END
More information about the User
mailing list