- # //Thoi gian he dieu hanh da hoat dong (mili giay)
- Console.WriteLine("Ticks since startup : " + Environment.TickCount);
Tác giả: Sưu tầm
Mô tả: Xác định thông tin hệ điều hành
Mã: Chọn hết
- using System;
-
- class ChuongTrinh
- {
- static void Main()
- {
- //Dong lenh de chay chuong trinh nay
- Console.WriteLine("Command line : " + Environment.CommandLine);
-
- //Phien ban he dieu hanh
- Console.WriteLine("OS PlatformID : " + Environment.OSVersion.Platform);
- Console.WriteLine("OS Major Version : " + Environment.OSVersion.Version.Major);
- Console.WriteLine("OS Minor Version : " + Environment.OSVersion.Version.Minor);
- Console.WriteLine("CLR Version : " + Environment.Version);
-
- //Ten nguoi dung dang chay chuong trinh
- Console.WriteLine("User Name : " + Environment.UserName);
-
- //User dang ky
- Console.WriteLine("Domain Name : " + Environment.UserDomainName);
-
- //Ten may
- Console.WriteLine("Machine name : " + Environment.MachineName);
-
- //Kiem tra ung dung la cua nguoi dung khong hay la dich vu
- Console.WriteLine("Is interactive ? : " + Environment.UserInteractive);
-
- Console.WriteLine("Shutting down ? : " + Environment.HasShutdownStarted);
-
- //Thoi gian he dieu hanh da hoat dong (mili giay)
- Console.WriteLine("Ticks since startup : " + Environment.TickCount);
-
- // Liet ke cac o dia co tren may
- foreach (string s in Environment.GetLogicalDrives())
- {
- Console.WriteLine("Logical drive : " + s);
- }
-
- // Cac thu muc chinh
- Console.WriteLine("Current folder : " + Environment.CurrentDirectory);
- Console.WriteLine("System folder : " + Environment.SystemDirectory);
-
- // Liet ke cac thu muc dac biet
- foreach (Environment.SpecialFolder s in Enum.GetValues(typeof(Environment.SpecialFolder)))
- {
- Console.WriteLine("{0} folder : {1}", s, Environment.GetFolderPath(s));
- }
-
- Console.ReadLine();
- }
- }
-