且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

获取PC注册的域/工作组名称

更新时间:2023-12-02 17:28:46

On 2004年7月14日星期三16:44:12 +0200,Mark Hollander< ma ** @ atcom.co.za>写道:

$ b $b¤我如何获得计算机具有的工作组或域的名称
$ b $b¤已注册。

¤


以下使用ADSI:


Dim SystemInfo As Object


SystemInfo = CreateObject (ADSystemInfo)

Console.WriteLine(SystemInfo.DomainShortName)

保罗~~~ pc ****** @ ameritech.net

Microsoft MVP(Visual Basic)


你可以也使用WMI ...


将计算机视为新的WMISample.ROOT.CIMV2.ComputerSystem

computer.path =

System.Management.ManagementPath(" MyComp\root\CIMV 2:Win32_ComputerSystem.Nam

e ="" MyComp""")


Messagebox.Show(computer.Domain)//显示域名或工作组名称)


Telmo Sampaio


" ; Mark Hollander &LT;毫安** @ atcom.co.za&GT;在消息中写道

news:si ******************************** @ 4ax.com ...
如何获取计算机已注册的工作组或域的名称。

谢谢
Mark Hollander

谢谢
Mark Hollander



问题是我无法在

Windows98 / WindowsME机器。


有没有其他方法可以获得工作组/域名


谢谢

Mark Hollander


***通过Developersdex发送 http://www.developersdex.com ***

不要只是参加USENET ......获得奖励!

How do I get the name of the Workgroup or Domain that the computer has
been registered in.

Thank you
Mark Hollander

Thank you
Mark Hollander

On Wed, 14 Jul 2004 16:44:12 +0200, Mark Hollander <ma**@atcom.co.za> wrote:

¤ How do I get the name of the Workgroup or Domain that the computer has
¤ been registered in.
¤

The following uses ADSI:

Dim SystemInfo As Object

SystemInfo = CreateObject("ADSystemInfo")
Console.WriteLine(SystemInfo.DomainShortName)
Paul ~~~ pc******@ameritech.net
Microsoft MVP (Visual Basic)


You can use WMI as well...

Dim computer as New WMISample.ROOT.CIMV2.ComputerSystem

computer.path =
System.Management.ManagementPath("MyComp\root\CIMV 2:Win32_ComputerSystem.Nam
e=""MyComp""")

Messagebox.Show(computer.Domain) //Shows Domain name or Workgroup name)

Telmo Sampaio

"Mark Hollander" <ma**@atcom.co.za> wrote in message
news:si********************************@4ax.com...
How do I get the name of the Workgroup or Domain that the computer has
been registered in.

Thank you
Mark Hollander

Thank you
Mark Hollander



The problem is that I cannot use these 2 examples on a
Windows98/WindowsME machine.

Is there any other way I can get the Workgroup/Domain name

Thank You
Mark Hollander

*** Sent via Developersdex http://www.developersdex.com ***
Don''t just participate in USENET...get rewarded for it!