How to get the current OS name and version in VB.NET

1 Answer

0 votes
Imports System
Imports System.Runtime.InteropServices

Public Class Program
	Public Shared Sub Main()
        Dim osDescription As String = RuntimeInformation.OSDescription
        Dim osArchitecture As String = RuntimeInformation.OSArchitecture.ToString()
		
        Console.WriteLine($"Operating System: {osDescription}")
        Console.WriteLine($"Architecture: {osArchitecture}")
    End Sub
End Class


 
' run:
'
' Operating System: Ubuntu 24.04.1 LTS
' Architecture: X64
'

 



answered Mar 27, 2025 by avibootz

Related questions

1 answer 95 views
1 answer 100 views
1 answer 102 views
1 answer 105 views
1 answer 111 views
1 answer 74 views
1 answer 94 views
...