seems your platform setting is != "x86"
regards
Karl-Heinz
Get IP Address
Get IP Address
Hi Joe,
May I suggest a more complex solution
Try this :
Calling it with
Regards,
Fab
May I suggest a more complex solution
Try this :
Code: Select all
using System.Net.NetworkInformation
USING System.Net.Sockets
PUBLIC CLASS NetworkTools
PUBLIC STATIC METHOD GetAllIPv4(netType AS NetworkInterfaceType ) AS List<STRING>
RETURN (;
FROM x IN ;
(;
FROM x IN NetworkInterface.GetAllNetworkInterfaces();
WHERE (x:NetworkInterfaceType == netType) .AND. (x:OperationalStatus == OperationalStatus.Up);
SELECT x;
);
:SelectMany({x AS NetworkInterface => x:GetIPProperties():UnicastAddresses});
WHERE x:Address:AddressFamily == AddressFamily.InterNetwork;
SELECT x:Address:ToString();
):ToList()
PUBLIC STATIC METHOD GetAllLocalIPv4() AS List<STRING>
LOCAL allLocalIPv AS List<STRING>
// Wired
allLocalIPv := GetAllIPv4(NetworkInterfaceType.Ethernet)
// Wifi
allLocalIPv:AddRange(GetAllIPv4(NetworkInterfaceType.Wireless80211))
RETURN allLocalIPv
END CLASS
Code: Select all
VAR IPs := NetworkTools.GetAllLocalIPv4()
FOREACH VAR ip IN IPs
? ip
NEXT
Fab
XSharp Development Team
fabrice(at)xsharp.eu
fabrice(at)xsharp.eu
Get IP Address
Karl-Heinz,
<argh> - one click and all running fine...
Thx
<argh> - one click and all running fine...
Thx
Regards
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)
Karl
(on Win8.1/64, Xide32 2.20, X#2.20.0.3)