Get IPv6 address
Nov 27
Today, I've found how to get IP address of IPv6. Because we're using IPv6 address in our office and normally so far to use for IPv4 in Window7. That's why I gotta retrieve address of IPv6. On the other hand, CGI variable can retrieve IPv4 address of client machine.
How to get IPv6 is as follow. First of all, we need to create Java object first which called "java.net.InetAddress". Then, write as follow.
2<cfoutput>#gethost.getLocalHost()#</cfoutput>
3
4<!--- Output will be as follow --->
5PPSHEIN-PC/192.168.3.11
Honestly, it's combined with computer name/IP address. What I want is IP address only. That's why I need to remove computer name. There is two way to get IP address in above result.
- Using List function
- Using built-in function
Using list function
2<cfoutput>#ListLast(returnIP, "/")#</cfoutput>

Android
Top of Page