本文整理汇总了C#中Host.getHostname方法的典型用法代码示例。如果您正苦于以下问题:C# Host.getHostname方法的具体用法?C# Host.getHostname怎么用?C# Host.getHostname使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Host
的用法示例。
在下文中一共展示了Host.getHostname方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: isReachable
public bool isReachable(Host h)
{
if (!Preferences.instance().getBoolean("connection.hostname.check"))
{
return true;
}
try
{
//todo honour proxy settings
TcpClient clnt = new TcpClient(h.getHostname(), h.getPort());
clnt.Close();
return true;
}
catch (Exception)
{
return false;
}
}
示例2: isSOCKSProxyEnabled
public override bool isSOCKSProxyEnabled(Host host)
{
Uri proxy = GetProxy("socks://", host.getHostname());
return !proxy.Equals(new Uri("socks://" + host.getHostname()));
}
示例3: isHTTPProxyEnabled
public override bool isHTTPProxyEnabled(Host host)
{
Uri proxy = GetProxy("http://", host.getHostname());
return !proxy.Equals(new Uri("http://" + host.getHostname()));
}
示例4: getSOCKSProxyPort
public override int getSOCKSProxyPort(Host host)
{
Uri proxy = GetProxy("socks://", host.getHostname());
return proxy.Port;
}
示例5: getSOCKSProxyHost
public override string getSOCKSProxyHost(Host host)
{
Uri proxy = GetProxy("socks://", host.getHostname());
return proxy.Host;
}
示例6: getHTTPSProxyPort
public override int getHTTPSProxyPort(Host host)
{
Uri proxy = GetProxy("https://", host.getHostname());
return proxy.Port;
}
示例7: getHTTPSProxyHost
public override string getHTTPSProxyHost(Host host)
{
Uri proxy = GetProxy("https://", host.getHostname());
return proxy.Host;
}