本文介绍了使用.NET获取服务标签戴尔机?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个拉模型信息(硬件信息)的类
对于本地机器code是像这样:

 进口System.Management公共类clsWMI
    私人objOS作为ManagementObjectSearcher
    私人objCS作为ManagementObjectSearcher
    私人objMgmt作为的ManagementObject
    私人m_strComputerName作为字符串
    私人m_strManufacturer作为字符串
    私人m_StrModel作为字符串
    私人m_strOSName作为字符串
    私人m_strOSVersion作为字符串
    私人m_strSystemType作为字符串
    私人m_strTPM作为字符串
    私人m_strWindowsDir作为字符串
    的Public Sub New()        objOS =新ManagementObjectSearcher(SELECT * FROM Win32_OperatingSystem)
        objCS =新ManagementObjectSearcher(SELECT * FROM的Win32_ComputerSystem)
        对于每个objMgmt在objOS.Get
            m_strOSName = objMgmt(名)。的ToString()
            m_strOSVersion = objMgmt(版本)。的ToString()
            m_strComputerName = objMgmt(csname)。的ToString()
            m_strWindowsDir = objMgmt(windowsdirectory)。的ToString()
        下一个        对于每个objMgmt在objCS.Get
            m_strManufacturer = objMgmt(制造商)。的ToString()
            m_StrModel = objMgmt(模式)。的ToString()
            m_strSystemType = objMgmt(SYSTEMTYPE)。的ToString
            m_strTPM = objMgmt(totalphysicalmemory)。的ToString()
        下一个
    结束小组    公共只读属性计算机名()
        得到
            计算机名= m_strComputerName
        到底得的    高端物业
    公共只读属性制造商()
        得到
            制造商= m_strManufacturer
        到底得的    高端物业
    公共只读属性模型()
        得到
            模型= m_StrModel
        到底得的    高端物业
    公共只读属性OSNAME()
        得到
            OSNAME = m_strOSName
        到底得的    高端物业    公共只读属性OSVERSION()
        得到
            OSVERSION = m_strOSVersion
        到底得的    高端物业
    公共只读属性SystemType中()
        得到
            = SystemType中m_strSystemType
        到底得的    高端物业
    公共只读属性TotalPhysicalMemory()
        得到
            TotalPhysicalMemory = m_strTPM
        到底得的    高端物业    公共只读属性WindowsDirectory()
        得到
            WindowsDirectory = m_strWindowsDir
        到底得的    高端物业末级

任何可能性,以获得WMI服务标签?从客户端的形式显示我像这样的值:

 昏暗objWMI作为新clsWMI()
        随着objWMI
            的Debug.WriteLine(计算机名称=&放大器; .ComputerName)
            Me.Label1.Text =姓名:&放大器; .ComputerName
            的Debug.WriteLine(计算机制造商=&放大器; .Manufacturer)
            Me.Label2.Text =制造商:&放大器; .Manufacturer
            的Debug.WriteLine(计算机模型=&安培;。型号)
            Me.Label3.Text =模式:&放大器; 。模型
            的Debug.WriteLine(OS名称=&放大器; .OsName)
            Me.Label4.Text =操作系统名称:&放大器; .OsName
            的Debug.WriteLine(OS版本=&放大器; .OSVersion)
            Me.Label5.Text =操作系统版本:&放大器; .OSVersion            的Debug.WriteLine(系统类型=&放大器; .SystemType)
            Me.Label6.Text =系统类型=&放大器; 。系统类型            的Debug.WriteLine(总的物理内存=&放大器; .TotalPhysicalMemory)
            Me.Label7.Text =记忆:&放大器; .TotalPhysicalMemory
            的Debug.WriteLine(Windows目录=&放大器; .WindowsDirectory)
            Me.Label8.Text =赢目录:&放大器; .WindowsDirectory
        结束与


解决方案

我认为你需要从这样的BIOS获得序列号:

 选择的SerialNumber从Win32_BIOS

在戴尔相信此相对应的服务标签

I've got a class that pulls model information (hardware info) for a local machine code is like so:

   Imports System.Management

Public Class clsWMI
    Private objOS As ManagementObjectSearcher
    Private objCS As ManagementObjectSearcher
    Private objMgmt As ManagementObject
    Private m_strComputerName As String
    Private m_strManufacturer As String
    Private m_StrModel As String
    Private m_strOSName As String
    Private m_strOSVersion As String
    Private m_strSystemType As String
    Private m_strTPM As String
    Private m_strWindowsDir As String


    Public Sub New()

        objOS = New ManagementObjectSearcher("SELECT * FROM Win32_OperatingSystem")
        objCS = New ManagementObjectSearcher("SELECT * FROM Win32_ComputerSystem")
        For Each objMgmt In objOS.Get


            m_strOSName = objMgmt("name").ToString()
            m_strOSVersion = objMgmt("version").ToString()
            m_strComputerName = objMgmt("csname").ToString()
            m_strWindowsDir = objMgmt("windowsdirectory").ToString()
        Next

        For Each objMgmt In objCS.Get
            m_strManufacturer = objMgmt("manufacturer").ToString()
            m_StrModel = objMgmt("model").ToString()
            m_strSystemType = objMgmt("systemtype").ToString
            m_strTPM = objMgmt("totalphysicalmemory").ToString()
        Next
    End Sub

    Public ReadOnly Property ComputerName()
        Get
            ComputerName = m_strComputerName
        End Get

    End Property
    Public ReadOnly Property Manufacturer()
        Get
            Manufacturer = m_strManufacturer
        End Get

    End Property
    Public ReadOnly Property Model()
        Get
            Model = m_StrModel
        End Get

    End Property
    Public ReadOnly Property OsName()
        Get
            OsName = m_strOSName
        End Get

    End Property

    Public ReadOnly Property OSVersion()
        Get
            OSVersion = m_strOSVersion
        End Get

    End Property
    Public ReadOnly Property SystemType()
        Get
            SystemType = m_strSystemType
        End Get

    End Property
    Public ReadOnly Property TotalPhysicalMemory()
        Get
            TotalPhysicalMemory = m_strTPM
        End Get

    End Property

    Public ReadOnly Property WindowsDirectory()
        Get
            WindowsDirectory = m_strWindowsDir
        End Get

    End Property

End Class

Any possibility to get a service tag from WMI ? From the client side form I display values like so:

   Dim objWMI As New clsWMI()
        With objWMI
            Debug.WriteLine("Computer Name = " & .ComputerName)
            Me.Label1.Text = "Name: " & .ComputerName
            Debug.WriteLine("Computer Manufacturer = " & .Manufacturer)
            Me.Label2.Text = "Manufacturer: " & .Manufacturer
            Debug.WriteLine("Computer Model = " & .Model)
            Me.Label3.Text = "Model: " & .Model
            Debug.WriteLine("OS Name = " & .OsName)
            Me.Label4.Text = "OS Name: " & .OsName
            Debug.WriteLine("OS Version = " & .OSVersion)
            Me.Label5.Text = "OS VERSION: " & .OSVersion

            Debug.WriteLine("System Type = " & .SystemType)
            Me.Label6.Text = "System type = " & .SystemType

            Debug.WriteLine("Total Physical Memory = " & .TotalPhysicalMemory)
            Me.Label7.Text = "Memory: " & .TotalPhysicalMemory
            Debug.WriteLine("Windows Directory = " & .WindowsDirectory)
            Me.Label8.Text = "Win Directory: " & .WindowsDirectory
        End With
解决方案

I think you need to get the serial number from the BIOS like this:

Select SerialNumber From Win32_BIOS

On Dell's I believe this corresponds to the service tag

这篇关于使用.NET获取服务标签戴尔机?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-31 06:58