本文整理汇总了Java中com.pi4j.system.NetworkInfo类的典型用法代码示例。如果您正苦于以下问题:Java NetworkInfo类的具体用法?Java NetworkInfo怎么用?Java NetworkInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NetworkInfo类属于com.pi4j.system包,在下文中一共展示了NetworkInfo类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: PlaySongHttpHandler
import com.pi4j.system.NetworkInfo; //导入依赖的package包/类
public PlaySongHttpHandler()
{
logger = Logger.getLogger(getClass().getName());
try
{
System.out.println("Hostname : " + NetworkInfo.getHostname());
for (String ipAddress : NetworkInfo.getIPAddresses())
{
System.out.println("IP Addresses : " + ipAddress);
}
}
catch (Exception ex)
{
Logger.getLogger(PlaySongHttpHandler.class.getName()).log(Level.SEVERE, null, ex);
}
String osName = SystemInfo.getOsName();
System.out.println("OS Name : " + osName);
if(osName.contains("Mac") ||
osName.contains("Windows"))
{
System.out.println("The application is NOT running on Raspberry Pi.");
}
else
{
rtttlService = new RtttlService();
}
}
示例2: getHostname
import com.pi4j.system.NetworkInfo; //导入依赖的package包/类
public String getHostname() throws IOException, InterruptedException {
return NetworkInfo.getHostname();
}
示例3: getIPAddresses
import com.pi4j.system.NetworkInfo; //导入依赖的package包/类
public String[] getIPAddresses() throws IOException, InterruptedException {
return NetworkInfo.getIPAddresses();
}
示例4: getIPAddress
import com.pi4j.system.NetworkInfo; //导入依赖的package包/类
public String getIPAddress() throws IOException, InterruptedException {
return NetworkInfo.getIPAddress();
}
示例5: getFQDN
import com.pi4j.system.NetworkInfo; //导入依赖的package包/类
public String getFQDN() throws IOException, InterruptedException {
return NetworkInfo.getFQDN();
}
示例6: getNameservers
import com.pi4j.system.NetworkInfo; //导入依赖的package包/类
public String[] getNameservers() throws IOException, InterruptedException {
return NetworkInfo.getNameservers();
}
示例7: getFQDNs
import com.pi4j.system.NetworkInfo; //导入依赖的package包/类
public String[] getFQDNs() throws IOException, InterruptedException {
return NetworkInfo.getFQDNs();
}