browse {&browse-name}:refresh()
There are three different methot to get computer name. 1. OS-GETENV Function : MESSAGE OS-GETENV("COMPUTERNAME") SKIP OS-GETENV("HOSTNAME") SKIP VIEW-AS ALERT-BOX INFO BUTTONS OK. 2. Use hostname utility : (windows only) DEFINE VARIABLE cHost AS CHARACTER NO-UNDO. INPUT THROUGH hostname NO-ECHO. SET cHost. INPUT CLOSE. DISPLAY cHost. 3. Using .NET assemblies ( Also available get Local IP adress ): DEFINE VARIABLE oIPHostEntry AS System.Net.IPHostEntry NO-UNDO. DEFINE VARIABLE oIPAddress AS System.Net.IPAddress NO-UNDO. DEFINE VARIABLE cIPAddresses AS CHARACTER NO-UNDO. DEFINE VARIABLE iCount AS INTEGER NO-UNDO INITIAL 1. oIPHostEntry = System.Net.Dns:GetHostEntry(System.Net.Dns:GetHostName()). DO WHILE TRUE: oIPAddress = CAST(oIPHostEntry:AddressList:GetValue(iCount),"System.Net.IPAddress") NO-ERROR. IF ERROR-STATUS:NUM-MESSAGES GT 0 THEN L
Yorumlar
Yorum Gönder