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 205 views
1 answer 211 views
1 answer 204 views
1 answer 216 views
1 answer 230 views
1 answer 174 views
1 answer 198 views
...