All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
C#文件处理技术:判断文件是否存在
SQL SERVER数据库开发之存储过程的应用_[SQL Server教程]
ASP.NET技巧:数据导出到Excel最为简易的方法_[Asp.Net教程]
ASP.NET技巧:慎用url重写_[Asp.Net教程]
注意那些容易被忽略的SQL注入技巧_[SQL Server教程]_0
Asp.Net使用POST方法最简单的实现_[Asp.Net教程]
LINQ体验(8)——LINQ,to,SQL语句之Union,All,、Union、,Intersect
ASP.NET之上传文件管理策略_.net资料_编程技术
windows下Apache2+php4+MySql5集成简明教程_[PHP教程]
ASP.NET,2.0打造购物车和支付系统之二_[Asp.Net教程]
Reading number is top 10 pictures
关于海盗的研究
Fan bingbing black wings for platform and DanLuoWang believes beauty2
含苞欲放的素颜美少女3
Sora aoi mirror memorial classics1
到底是谁撞谁呀?
BingBingFan apple dew point photo gallery4
Hunan province aizhai super-large suspension bridge open to traffic and 4 world first1
Sora aoi mirror memorial classics3
The real super beauty7
Wild animals melee moment of life and death2
Download software ranking
Tram sex maniac 2 (H) rar bag18
linux高级编程
终极变速大师Speeder3.26
SP3 for SQL2000
都市狐狸姑娘传
仙剑奇侠传98版歌曲
Tram sex maniac 2 (H) rar bag4
Boxer Classic video3
Such love down(擒爱记)
I'm come from Beijing1
aaa published in(发表于) 2013/12/6 10:26:07 Edit(编辑)
C#:如何获取当前操作系统的软件版本_.net资料_编程技术

C#:如何获取当前操作系统的软件版本_.net资料_编程技术

C#:如何获取当前操作系统的软件版本_.net资料_编程技术-数科优化网

我是一个C#的初学者,这是我参考一些资料,自己弄的一个通过访问当前操作系统的注册表来获取当前操作系统相关信息的小程序,仅供参考。


1using System;
2using System.Collections.Generic;
3using System.ComponentModel;
4using System.Data;
5using System.Drawing;
6using System.Text;
7using System.Windows.Forms;
8using Microsoft.Win32;
9
10namespace Reg4U
11{
12 public partial class Form1 : Form
13 {
14 public Form1()
15 {
16 InitializeComponent();
17 }
18
19 private void button1_Click(object sender, EventArgs e)
20 {
21 RegistryKey rk;
22 rk = Registry.LocalMachine.OpenSubKey("Software\\Microsoft\\Windows NT\\CurrentVersion");
23 string s= "当前操作系统版本:"+rk.GetValue("ProductName").ToString();
24 s = s +"\r\n"+rk.GetValue("CSDVersion").ToString() ;
25 s = s + "\r\n当前操作系统安装序列号:\r\n" + rk.GetValue("ProductId").ToString();
26 s = s + "\r\n当前系统版本号:" + rk.GetValue("CurrentBuildNumber").ToString();
27 rk.Close();
28 textBox1.Text = textBox1.Text+"\r\n"+s;
29 }
30
31 private void Form1_Load(object sender, EventArgs e)
32 {
33 RegistryKey rk;
34 rk = Registry.LocalMachine.OpenSubKey("Software\\Microsoft\\Windows NT\\CurrentVersion");
35 string s = rk.GetValue("ProductName").ToString();
36 if (System.Text.RegularExpressions.Regex.IsMatch(s, "Windows 2000"))
37 {
38 textBox1.Text = "您的操作系统是2K,恭喜您,你的当前系统适合本软件的使用!";
39 }
40 rk.Close();
41 }
42 }
43}






添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.