using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication3
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
//현재 시스템 변수를 선언
OperatingSystem os = Environment.OSVersion;
string Name = "알 수 없음";
//현재 활성화된 프로세서 수를 측정후 반영
label3.Text = Environment.ProcessorCount.ToString();
label5.Text = Environment.Version.ToString();
//마우스 정보를 위해 타이머 스타트
timer1.Start();
//OS버전별 교환
switch (os.Platform)
{
case PlatformID.Win32Windows:
{
if (os.Version.Major == 4)
{
switch (os.Version.Minor)
{
case 0:
Name = "Windows 95";
break;
case 10:
Name = "Windows 98";
break;
case 90:
Name = "Windows Me";
break;
}
}
break;
}
case PlatformID.Win32NT:
{
if (os.Version.Major == 4)
{
Name = "Windows NT 4.0";
}
else if (os.Version.Major == 5)
{
switch (os.Version.Minor)
{
case 0:
Name = "Windows 2000";
break;
case 1:
Name = "Windows XP";
break;
case 2:
Name = "Windows Server 2003";
break;
}
}
else if (os.Version.Major == 6)
{
switch (os.Version.Minor)
{
case 0:
Name = "Windows Vista";
break;
case 1:
Name = "Windows 7";
break;
}
}
}
break;
default:
break;
}
label1.Text = Name;
}
private void timer1_Tick(object sender, EventArgs e)
{
System.Drawing.Point pt = Control.MousePosition;
label7.Text = "X 좌표 : " + pt.X.ToString() + " Y 좌표 : " + pt.Y.ToString();
}
}
}