Tác giả: Tổng hợp
Mô tả: Chỉ cho phép ứng dụng VB.NET chạy trên Windows XP
Code: Select all
Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'nếu không phải hệ điều hành Windows XP If My.Computer.Info.OSFullName <> "Microsoft Windows XP Professional" Then 'Đưa ra câu thông báo pro như của bác Bill ^_^ MsgBox("Some features in this application may not work as it requires Microsoft Windows XP Professional", , "Compatability Warning") 'kết thúc chương trình luôn Return End If End SubEnd Class
Code: Select all
Microsoft.VisualBasic.Devices.Computer myComputer = new Microsoft.VisualBasic.Devices.Computer(); string OSFullName = myComputer.Info.OSFullName; if (OSFullName != "Microsoft Windows XP Professional") { Console.WriteLine("Not Microsoft Windows XP Professional"); } else { Console.WriteLine(myComputer.Info.OSFullName); } Console.ReadKey();