Classic ASP
Classic ASP
Get Local Network Adapter Addresses
See more Socket/SSL/TLS Examples
Demonstrates Socket.GetAdaptersAddresses, which populates a JsonObject with information about local network adapters, including IPv4 addresses, IPv6 addresses, and MAC addresses.
Tip: Code to parse the returned JSON can be generated with Chilkat's online tool at https://tools.chilkat.io/jsonParse.
Background. This provides a portable way to enumerate the host's network interfaces and their addresses.
Chilkat Classic ASP Downloads
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<%
success = 0
set socket = Server.CreateObject("Chilkat.Socket")
' Populate a JsonObject with information about the local network adapters, including IPv4 addresses,
' IPv6 addresses, and MAC addresses.
set json = Server.CreateObject("Chilkat.JsonObject")
success = socket.GetAdaptersAddresses(json)
If (success = 0) Then
Response.Write "<pre>" & Server.HTMLEncode( socket.LastErrorText) & "</pre>"
Response.End
End If
json.EmitCompact = 0
jsonStr = json.Emit()
Response.Write "<pre>" & Server.HTMLEncode( jsonStr) & "</pre>"
' JSON parsing code for this result can be generated at Chilkat's online tool:
' https://tools.chilkat.io/jsonParse
%>
</body>
</html>