我如何在.NET的计算机名 [英] How do I get the computer name in .NET

查看:169
本文介绍了我如何在.NET的计算机名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何在.NET C#中的计算机名称

How do I get the computer name in .NET c#

推荐答案

  • <一个href="http://msdn.microsoft.com/en-us/library/system.environment.machinename.aspx"><$c$c>System.Environment.MachineName
  • <一个href="http://msdn.microsoft.com/en-us/library/system.web.httpserverutility.machinename.aspx"><$c$c>HttpContext.Current.Server.MachineName
  • <一个href="http://msdn.microsoft.com/en-us/library/system.net.dns.gethostname.aspx"><$c$c>System.Net.Dns.GetHostName()

请参阅如何找到本地计算机的FQDN在C#/。NET?如果最后不给你的FQDN,你需要它。

See How to find FQDN of local machine in C#/.NET ? if the last doesn't give you the FQDN and you need it.

这篇关于我如何在.NET的计算机名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆