有个方法-
public static String getHostByAddr(byte[] addr) throws UnknownHostException {
Name name = ReverseMap.fromAddress(InetAddress.getByAddress(addr));
final String[] servers = new String[] {"208.67.220.220", "208.67.222.222"};
final Resolver res = new ExtendedResolver(
我正在尝试通过vb.net获取客户端ID。我的代码如下:
Partial Class foo
Inherits System.Web.UI.Page
Private ipv4 As New clsIPv4
Dim ref As String = 0
Dim client_ip As String
client_ip = Request.UserHostAddress()
Dim myHost As String = System.Net.Dns.GetHostName()
client_ip = ipv4.ResolveAddress(myHost)
此代码
我有一个Windows窗体应用程序在终端服务器上运行。我需要确定每台客户机的IP地址。
我找到了一种方法来检索具有DNS条目的计算机的IP地址(如下例所示),但我的几个瘦客户机设置了静态IP,并且没有DNS名称。有没有办法在没有DNS名称的情况下确定远程客户端的IP地址?
Dim clientName As String = My.Computer.Network.ClientName
Dim IPHost As Net.IPHostEntry = Net.Dns.Resolve(clientName & "domain.com")
Dim addresses As
我试图在任意IP地址上运行who-is命令,以便内部使用(没有公共访问):
function echo_whois($ip)
{
$host = gethostbyaddr($ip);
//How to get domain from host?
//$domain = ?
echo("<pre>");
echo(shell_exec("whois ".$domain));
echo("</pre>");
}
问题是,我似乎找不到从domain name获得host na
我正在开发一个c#控制台应用程序,在我的控制台应用程序中,我有以下代码,用于获取网站的IP:
using System.Net
using System.Web;
using System.IO;
namespace MyConsoleApp
{
class Program
{
static async Task Main(string[] args)
{
IPHostEntry hosten = Dns.GetHostEntry("www." + website);
if (hosten.A