Categories: News

Detect Graphics Card Programmatically Using Visual Basic

Detect Graphics Card Name

Is it possible to detect the graphics card name from .Net code? Yes it is possible using WMI. But you need to reference the System.Management and import it.

Windows Management Instrumentation

WMI is a great library which contains the details about various components required for the system to operate. Hard Disk Drive related information, processor information, Network components and the list goes on. It is really easy to query the data if you know a little about the data how it is organized.

Using WMI to Get the Graphics Card Name

WMI can be used to query a lot of information about hardware and Operating systems related information. ManagementObjectSearcher can be used to query the data. It accepts two parameters. The first parameter is to tell which section to search called as scope. And the second parameter is the actual query almost similar to SQL query. Using the Get method of ManagementObjectSearcher will give the result set in a collection.

Source Code

Imports System.Management

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, _

ByVal e As System.EventArgs) Handles Button1.Click

MsgBox(GetGraphicsCardName())

End Sub

Private Function GetGraphicsCardName() As String

Dim GraphicsCardName = String.Empty

Try

Dim WmiSelect As New ManagementObjectSearcher _

(“rootCIMV2”, “SELECT * FROM Win32_VideoController”)

For Each WmiResults As ManagementObject In WmiSelect.Get()

GraphicsCardName = WmiResults.GetPropertyValue(“Name”).ToString

If (Not String.IsNullOrEmpty(GraphicsCardName)) Then

Exit For

End If

Next

Catch err As ManagementException

MessageBox.Show(err.Message)

End Try

Return GraphicsCardName

End Function

End Class

Continue Reading
techfeatured

Recent Posts

Unlock Detailed Vehicle Information with VINDECODERZ

VINDECODERZ offers comprehensive and reliable VIN decoding services to provide users with detailed vehicle information…

1 day ago

Trending Innovations in Auto Repair: How Modern Technology Shapes Service Quality

Table of Contents: Key Takeaways Understanding the Impact of Diagnostic Software Electric and Hybrid Vehicles:…

1 week ago

Exploring the Impact of Trigger Kits on Firearm Performance and Safety

Key Takeaways: Custom trigger kits can offer personalization while potentially improving shooting accuracy and performance.…

2 weeks ago

Extending Vehicle Longevity: The Impact of Ceramic Coatings on Car Maintenance

Ensuring a vehicle's longevity requires more than just regular servicing; it encompasses a broader approach…

3 weeks ago

Better Care with Tech: How Skilled Use of Medical Tools Saves Lives

Technological developments in medicine have raised the bar for patient care to an unprecedented degree,…

1 month ago

Choosing the Right Platform: Options for Website Creation

In the digital era, having a website is essential for businesses, organizations, and individuals alike.…

1 month ago