메뉴 건너뛰기

Programing

C# 게시판

탭메뉴로 컴퓨터 속성 구현

관리자 2018.12.30 17:04 조회 수 : 145

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace _6
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        private void tabMenu_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (this.tabMenu.SelectedTab.Text == "일반")
            {
                this.tsslbl.Text = "일반";
                this.lbl06.Text = SystemInformation.UserName;
                this.lbl08.Text = SystemInformation.MouseButtons.ToString();
                this.lbl10.Text = SystemInformation.Network.ToString();
                this.lbl12.Text = SystemInformation.MonitorCount.ToString();
            }
            else if(this.tabMenu.SelectedTab.Text == "컴퓨터 이름")
            {
                this.tsslbl.Text = "컴퓨터 이름";
                this.lbl02.Text = SystemInformation.UserDomainName;
                this.lbl04.Text = SystemInformation.PowerStatus.PowerLineStatus.ToString();
            }
        }
    }
}
실행한 컴퓨터의 이름, 전원 상태, 네트워크 연결 여부, 사용자 이름,마우스 단추 개수, 모니터 개수를 보여준다.

위로