zoukankan      html  css  js  c++  java
  • 获取机器名

    Environment.MachineName;
    System.Net.Dns.GetHostName();
    System.Windows.Forms.SystemInformation.ComputerName;
    System.Environment.GetEnvironmentVariable("COMPUTERNAME");

    Environment.MachineName
    The name of this computer is established at system startup when the name is read from the registry. If this computer is a node in a cluster, the name of the node is returned.

    Environment.MachineName and System.Windows.Forms.SystemInformation.ComputerName are identical and returns the computer's NetBIOS name. This name is restricted to 15 characters and only visible on the LAN.

    System.Net.Dns.GetHostName() returns the computer's TCP/IP based hostname. By adding a domain suffix to the hostname you can resolve your computer's IP address across LANs / on the internet.

    System.Environment.GetEnvironmentVariable("COMPUTERNAME") returns the computer name set during installation. NetBIOS and hostname are initially set to the same name.

  • 相关阅读:
    [已解决] Python logging 重复打印日志信息
    scrapy
    Python 元编程
    MySQL性能优化 分区
    SQL Mode
    Golang 接口
    Python partial
    栈、队列(链表实现)
    Golang 位向量
    Java50题——学习以及思考
  • 原文地址:https://www.cnblogs.com/dennysong/p/5626275.html
Copyright © 2011-2022 走看看