본문 바로가기

Programing (프로그래밍)/WPF & C# (C Sharp)

WPF & C# (C Sharp) - Environment 로 부터 추출되는 data 각종 정보

728x90
반응형

【 WPF & C# (C Sharp) 】


Environment 로 부터 추출되는 data 각종 정보


SIS_system_data.zip

SIS_system_data.zip


 @ Environment 로 부터 추출되는 data

그냥 정리자료




@ MainWindow.xaml.cs


1
2
3
4
5
6
7
8
9
10
11
12
<Window x:Name="wnd" x:Class="SIS_system_data.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:SIS_system_data"
        mc:Ignorable="d"
        Title="MainWindow" Height="350" Width="525">
    <Grid x:Name="Grid1">
        <ListBox x:Name="LBox" ScrollViewer.CanContentScroll="False"/>
    </Grid>
</Window>
cs




@ MainWindow.xaml


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
 
namespace SIS_system_data
{
    /// <summary>
    /// MainWindow.xaml에 대한 상호 작용 논리
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
 
            Create_tBox("[ 실행파일의 디렉토리 ]");
            Create_tBox("Environment.CurrentDirectory");
            Create_tBox(Environment.CurrentDirectory);
 
            Create_tBox("[ OS가 64비트인지 여부 ]");
            Create_tBox("Environment.Is64BitOperatingSystem.ToString()");
            Create_tBox(Environment.Is64BitOperatingSystem.ToString());
 
            Create_tBox("[ 프로세스가 64비트인지 여부 ]");
            Create_tBox("Environment.Is64BitProcess");
            Create_tBox(Environment.Is64BitProcess.ToString());
 
            Create_tBox("[ NetBIOS NAME (MachineName)을 가져옴 ]");
            Create_tBox("Environment.MachineName");
            Create_tBox(Environment.MachineName);
 
            Create_tBox("[ OS Platform ID ]");
            Create_tBox("Environment.OSVersion.Platform");
            Create_tBox(Environment.OSVersion.Platform.ToString());
 
            Create_tBox("[ OS 서비스팩 / 윈10에서는 안나오나?]");
            Create_tBox("Environment.OSVersion.ServicePack");
            Create_tBox(Environment.OSVersion.ServicePack);
 
            Create_tBox("[ OS 버전 ]");
            Create_tBox("Environment.OSVersion.Version");
            Create_tBox(Environment.OSVersion.Version.ToString());
 
            Create_tBox("[ OS 버전 값 ]");
            Create_tBox("Environment.OSVersion.VersionString");
            Create_tBox(Environment.OSVersion.VersionString);
 
            Create_tBox("[ 프로세스 수 ]");
            Create_tBox("Environment.ProcessorCount");
            Create_tBox(Environment.ProcessorCount.ToString());
 
            Create_tBox("[ 시스템 디렉토리 위치 ]");
            Create_tBox("Environment.SystemDirectory");
            Create_tBox(Environment.SystemDirectory);
 
            Create_tBox("[ 운영체제의 메모리 페이지 사이즈 (byte) ]");
            Create_tBox("Environment.SystemPageSize");
            Create_tBox(Environment.SystemPageSize.ToString());
 
            Create_tBox("[ 부팅 후 경과시간 (Tick) ]");
            Create_tBox("Environment.TickCount");
            Create_tBox(Environment.TickCount.ToString());
 
            Create_tBox("[ 현재 사용자와 관련된 도메인 이름 ]");
            Create_tBox("Environment.UserDomainName");
            Create_tBox(Environment.UserDomainName);
 
            Create_tBox("[ 현재 프로세스가 대화형 모드로 실행되고 있는지 여부 ]");
            Create_tBox("Environment.UserInteractive");
            Create_tBox(Environment.UserInteractive.ToString());
 
            Create_tBox("[ 현재 사용자 이름 ]");
            Create_tBox("Environment.UserName");
            Create_tBox(Environment.UserName);
 
            Create_tBox("[ 공용언어 런타임의 Version ]");
            Create_tBox("Environment.Version");
            Create_tBox(Environment.Version.ToString());
 
            Create_tBox("[ 공용언어 런타임의 Version 의 빌드버전 ]");
            Create_tBox("Environment.Version.Build");
            Create_tBox(Environment.Version.Build.ToString());
 
            Create_tBox("[ 프로세스 컨텍스트에 매핑되는 실제 메모리의 크기 ]");
            Create_tBox("Environment.Version.Build");
            Create_tBox(Environment.WorkingSet.ToString());
 
            wnd.Width = 600;
            wnd.Height = 600;
            LBox.Width = wnd.Width -30;
            StackPanel1.Width = LBox.Width - 32;
            
            LBox.Items.Add(StackPanel1);
        }
 
        //버튼 생성
        int i = 0;
        StackPanel StackPanel1 = new StackPanel();
        private void Create_tBox(string str)
        {
            TextBox tBox = new TextBox();
            tBox.Name = "tBox" + ++i;
            tBox.Text = str;
            tBox.Height = 20;
            if (i % 3 == 0) tBox.Background = new SolidColorBrush(Color.FromArgb(255210220210));
            if (i % 3 == 1) tBox.Background = new SolidColorBrush(Color.FromArgb(255180180180));
            if (i % 3 == 2) tBox.Background = new SolidColorBrush(Color.FromArgb(255220220220));
            StackPanel1.Children.Add(tBox);
        }
    }
}
 
cs




http://insurang.tistory.com


728x90
반응형