[VB] Operating System Information

The following VB.NET program retrieves the current operating system information like version and platform identifier with the help of OperatingSystem Class and Environment Class.

The OperatingSystem Class provides a method to copy an instance of OperatingSystem, and a method to return a string representation of operating system information.

The OperatingSystem class is not a general purpose class and you cannot derive a more inclusive type from the OperatingSystem class. If you need a type to contain other information about an operating system, create your own type, then include a field of type OperatingSystem and any additional fields, properties, or methods you require.

The Environment Class provides information about, and means to manipulate, the current environment and platform. The Environment Class has a property called OSVersion which returns an object of type OperatingSystem.
 Dim _os As OperatingSystem
  _os = Environment.OSVersion

FULL CODE :
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

		Dim _os As OperatingSystem
		_os = Environment.OSVersion

		MsgBox(_os.VersionString.ToString)

	End Sub

End Class

2 تعليقات

✔ Bình luận có dấu, lịch sự và đúng chủ đề
❌ Không spam link, quảng cáo, từ ngữ phản cảm
❌ Không hỏi link tải, crack, nội dung vi phạm
⚠ Bình luận vi phạm sẽ bị xóa mà không báo trước

Thêm hình ảnh: [img] link hình ảnh [/img]
Thêm video youtube: [youtube] link video [/youtube]
Thêm code: [code] Đoạn code đã mã hóa [/code]

  1. lấy thông tin máy tính cần gì phải cần gì phải như vậy, cứ thế này là ok hết


    Label9.Text = My.Computer.Name
    Label10.Text = My.User.Name
    Label11.Text = My.Computer.Info.OSFullName
    Label12.Text = My.Computer.Clock.LocalTime

    ردحذف

إرسال تعليق

✔ Bình luận có dấu, lịch sự và đúng chủ đề
❌ Không spam link, quảng cáo, từ ngữ phản cảm
❌ Không hỏi link tải, crack, nội dung vi phạm
⚠ Bình luận vi phạm sẽ bị xóa mà không báo trước

Thêm hình ảnh: [img] link hình ảnh [/img]
Thêm video youtube: [youtube] link video [/youtube]
Thêm code: [code] Đoạn code đã mã hóa [/code]

أحدث أقدم