" Sıcak bir gülümseme, nezaketin evrensel dilidir. #Gülümse :) "

Vb.Net kullanarak PC BIOS bilgilerini görüntüleme

Bilgisayarimizin anakartinda dahili olarak bulunan ve bilgisayarin her açilisinda donanimlari kontrol etmesine yarayan, ve format islemleri sirasinda bios ayarlarindan bir kaç ayar yaparak CD;den veya USB;den baslatmamiza yarayan bios bilgilerini vb.net dili kullanarak görüntüleyelim. C# kullanilarakta görüntülenebilir veya farkli diller, burda dili bilmeniz yeterli olacaktir.

' System.Management kütüphanemizi projemize import etmeyi unutmuyoruz.
Imports System.Management
Public Class Form1

    Private Sub AnaKartSerial()
        Dim motherboardserial = String.Empty
        Dim mos As ManagementObjectSearcher = New ManagementObjectSearcher("SELECT * FROM Win32_BaseBoard")
        Dim moc As ManagementObjectCollection = mos.[Get]()

        For Each mo As ManagementObject In moc
            motherboardserial = CStr(mo("SerialNumber"))
            Exit For
        Next
        Label2.Text = motherboardserial
    End Sub

    Private Sub islemciSerial()
        Dim cpuid = String.Empty
        Dim sQuery As String = "SELECT ProcessorId FROM Win32_Processor"
        Dim oManagementObjectSearcher As ManagementObjectSearcher = New ManagementObjectSearcher(sQuery)
        Dim oCollection As ManagementObjectCollection = oManagementObjectSearcher.[Get]()

        For Each oManagementObject As ManagementObject In oCollection
            cpuid = CStr(oManagementObject("ProcessorId"))
            Exit For
        Next
        Label3.Text = cpuid
    End Sub

    Private Sub BiosBilgileri()
        Dim BIOSSürüm As String = Nothing
        Dim Version As String = Nothing
        Dim TargetOperatingSystem As String = Nothing
        Dim Status As String = Nothing
        Dim SoftwareElementState As String = Nothing
        Dim SoftwareElementID As String = Nothing
        Dim SMBIOSPresent As String = Nothing
        Dim SMBIOSMinorVersion As String = Nothing
        Dim SMBIOSMajorVersion As String = Nothing
        Dim SerialNumber As String = Nothing
        Dim ReleaseDate As String = Nothing
        Dim PrimaryBIOS As String = Nothing
        Dim Name As String = Nothing
        Dim Manufacturer As String = Nothing
        Dim ListOfLanguages() As String = Nothing
        Dim InstallableLanguages As String = Nothing
        Dim Description As String = Nothing
        Dim CurrentLanguage As String = Nothing
        Dim Caption As String = Nothing
        Dim BiosCharacteristics() As UShort = Nothing

        Dim sQuery As String = "Select * FROM WIN32_BIOS"
        Dim oManagementObjectSearcher As ManagementObjectSearcher = New ManagementObjectSearcher(sQuery)
        Dim oCollection As ManagementObjectCollection = oManagementObjectSearcher.[Get]()

        For Each oManagementObject As ManagementObject In oCollection
            BIOSSürüm = oManagementObject("SoftwareElementID")
            Version = oManagementObject("Version")
            TargetOperatingSystem = oManagementObject("TargetOperatingSystem")
            Status = oManagementObject("Status")
            SoftwareElementID = oManagementObject("SoftwareElementID")
            SoftwareElementState = oManagementObject("SoftwareElementState")
            SMBIOSPresent = oManagementObject("SMBIOSPresent")
            SMBIOSMinorVersion = oManagementObject("SMBIOSMinorVersion")
            SMBIOSMajorVersion = oManagementObject("SMBIOSMajorVersion")
            SerialNumber = oManagementObject("SerialNumber")
            ReleaseDate = oManagementObject("ReleaseDate")
            PrimaryBIOS = oManagementObject("PrimaryBIOS")
            Name = oManagementObject("Name")
            Manufacturer = oManagementObject("Manufacturer")
            ListOfLanguages = oManagementObject("ListOfLanguages")
            InstallableLanguages = oManagementObject("InstallableLanguages")
            Description = oManagementObject("Description")
            CurrentLanguage = oManagementObject("CurrentLanguage")
            Caption = oManagementObject("Caption")
            BiosCharacteristics = oManagementObject("BiosCharacteristics")
            Exit For
        Next
        lblBIOSSürüm.Text = BIOSSürüm
        lblVersion.Text = Version
        lblTargetOperating.Text = TargetOperatingSystem
        lblStatus.Text = Status
        lblSoftwareElementID.Text = SoftwareElementID
        lblSoftwareElementState.Text = SoftwareElementState
        lblSMBIOSPresent.Text = SMBIOSPresent
        lblSMBIOSMajorVersion.Text = SMBIOSMajorVersion
        lblSMBIOSMinorVersion.Text = SMBIOSMinorVersion
        lblSerialNumber.Text = SerialNumber
        lblReleaseDate.Text = ReleaseDate
        lblPrimaryBIOS.Text = PrimaryBIOS
        lblName.Text = Name
        lblManufacturer.Text = Manufacturer
        lblInstallableLanguages.Text = InstallableLanguages
        lblDescription.Text = Description
        lblCurrentLanguage.Text = CurrentLanguage
        lblCaption.Text = Caption
        ListOfLanguagesT.Text = ListOfLanguages(0)
        BiosCharacteristicsT.Text = BiosCharacteristics(0)
    End Sub

    Public Shared Function GetSerialsFromHardDrives() As List(Of String)
        Dim serials As New List(Of String)()
        Dim searcher As New ManagementObjectSearcher("SELECT * FROM Win32_PhysicalMedia")
        Dim disks As ManagementObjectCollection = searcher.[Get]()
        For Each disk As ManagementObject In disks
            If disk("SerialNumber") Is Nothing Then
                serials.Add("")
                Exit For
            Else
                serials.Add(disk("SerialNumber").ToString())
                Exit For
            End If
        Next
        Return serials
    End Function
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        AnaKartSerial()
        islemciSerial()
        BiosBilgileri()

        Dim HDDSerial As String = String.Empty
        Dim serialsList As List(Of String) = GetSerialsFromHardDrives()
        For Each s As String In serialsList
            HDDSerial = s
            Exit For
        Next
        Label6.Text = HDDSerial
        Label8.Text = SystemInformation.UserDomainName
    End Sub
End Class

Uygulama dosyasini buradan indirebilirsiniz.

  • 0
  • 95
  • 0

- BUNLARIDA GÖZDEN GEÇİREBİLİRSİNİZ -

HENÜZ YORUM YAPILMAMIŞ !

Yorum yazın

Hakkımda

BÜLTENİMİZE ABONE OLUN

SOSYAL AĞLAR

  • Bana yazın