WPF 中获取系统信息
2010-06-12 06:45
507 查看
首先添加 mscorlib assembly的命名空间引用
xmlns:r="clr-namespace:System;assembly=mscorlib"
XAML代码
<TextBlock>
<Label Content="Operating System Version : "></Label>
<Label Content="{x:Static r:Environment.OSVersion}"></Label>
<LineBreak></LineBreak>
<Label Content="Dot NET Version : "></Label>
<Label Content="{x:Static r:Environment.Version}"></Label>
<LineBreak></LineBreak>
<Label Content="Machine Name : "></Label>
<Label Content="{x:Static r:Environment.MachineName}"></Label>
<LineBreak></LineBreak>
<Label Content="User Name : "></Label>
<Label Content="{x:Static r:Environment.UserName}"></Label>
<LineBreak></LineBreak>
<Label Content="User Domain Name : "></Label>
<Label Content="{x:Static r:Environment.UserDomainName}"></Label>
<LineBreak></LineBreak>
<Label Content="System Directory : "></Label>
<Label Content="{x:Static r:Environment.SystemDirectory}"></Label>
</TextBlock>
xmlns:r="clr-namespace:System;assembly=mscorlib"
XAML代码
<TextBlock>
<Label Content="Operating System Version : "></Label>
<Label Content="{x:Static r:Environment.OSVersion}"></Label>
<LineBreak></LineBreak>
<Label Content="Dot NET Version : "></Label>
<Label Content="{x:Static r:Environment.Version}"></Label>
<LineBreak></LineBreak>
<Label Content="Machine Name : "></Label>
<Label Content="{x:Static r:Environment.MachineName}"></Label>
<LineBreak></LineBreak>
<Label Content="User Name : "></Label>
<Label Content="{x:Static r:Environment.UserName}"></Label>
<LineBreak></LineBreak>
<Label Content="User Domain Name : "></Label>
<Label Content="{x:Static r:Environment.UserDomainName}"></Label>
<LineBreak></LineBreak>
<Label Content="System Directory : "></Label>
<Label Content="{x:Static r:Environment.SystemDirectory}"></Label>
</TextBlock>
相关文章推荐
- android系统信息(内存,cpu,sd卡,电量,版本)的获取
- SQL Server安装程序无法获取ASPNET账户的系统账户信息
- iOS - (利用/调用系统定位获取当前经纬度与地理信息)
- VB中使用WMI获取系统硬件和软件有关信息
- Java如何获取系统信息(包括操作系统、jvm、cpu、内存、硬盘、网络、io等)
- 24、获取系统信息(包括操作系统版本、系统信息、运营商信息)
- 获取系统信息之Packages.xml文件
- 通过系统表获取SQL,Access,Oracle数据库的元数据信息
- 获取系统信息的有关Windows API
- linux系统使用python获取内存使用信息
- Java,jsp 获取jdk、系统、服务器等信息
- 主机性能监控系统--3.获取内存性能信息
- android 调用系统方法获取应用程序信息 如缓存大小
- Android系统信息获取
- Linux下通过ioctl系统调用来获取和设置网络信息
- Fortran一个获取硬件系统信息的函数库
- Android系统信息获取 之一:系统存储信息的获取(RAM,ROM,SDCard)
- Android 系统信息获取(CPU,RAM,ROM,Battery,SD-card,版本等)
- 远程或本地获取系统信息的脚本RGIS.vbs
- windows核心编程-获取系统中进程的信息