获取域名. [英] Getting the Domain Name.

查看:71
本文介绍了获取域名.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨Frnds.

如何使用C#.Net(Windows应用程序)查找域名..

即使用户以本地用户身份登录,也必须显示域名.
我的代码是


label1.Text = Environment.UserDomainName;

但是当用户以本地用户身份登录时,它将返回系统名称.

我的要求是它应该返回域名.

有人可以帮我吗?


问候,

Harish.

Hi Frnds.

How to find the Domain Name Using C#.Net (Windows Application)..

Even if the user loged in as local user then also it has to show the Domain Name.
My code is


label1.Text = Environment.UserDomainName;

But it is returning the systemname when user loged in as local user.

My requirement is it should return the Domain Name.

can anybody help me..


Regards,

Harish.

推荐答案

string domainName =
System.Net.NetworkInformation.IPGlobalProperties.GetIPGlobalProperties().DomainName;


这篇关于获取域名.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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