操作系统

获取当前操作系统的软件版本

时间:2025-03-03 05:59:18 操作系统 我要投稿
  • 相关推荐

获取当前操作系统的软件版本

  1usingSystem;

  2usingSystem.Collections.Generic;

  3usingSystem.ComponentModel;

  4usingSystem.Data;

  5usingSystem.Drawing;

  6usingSystem.Text;

  7usingSystem.Windows.Forms;

  8usingMicrosoft.Win32;

  9

  10namespaceReg4U

  11{

  12publicpartialclassForm1:Form

  13{

  14publicForm1()

  15{

  16InitializeComponent();

  17}

  18

  19privatevoidbutton1_Click(objectsender,EventArgse)

  20{

  21RegistryKeyrk;

  22rk=Registry.LocalMachine.OpenSubKey("Software\Microsoft\WindowsNT\CurrentVersion");

  23strings="当前操作系统版本:"rk.GetValue("ProdUCtName").ToString();

  24s=s" "rk.GetValue("CSDVersion").ToString();

  25s=s" 当前操作系统安装序列号: "rk.GetValue("ProductId").ToString();

  26s=s" 当前系统版本号:"rk.GetValue("CurrentBuildNumber").ToString();

  27rk.Close();

  28textBox1.Text=textBox1.Text" "s;

  29}

  30

  31privatevoidForm1_Load(objectsender,EventArgse)

  32{

  33RegistryKeyrk;

  34rk=Registry.LocalMachine.OpenSubKey("Software\Microsoft\WindowsNT\CurrentVersion");

  35strings=rk.GetValue("ProductName").ToString();

  36if(System.Text.RegularEXPressions.Regex.IsMatch(s,"windows2000"))

  37{

  38textBox1.Text="您的操作系统是2K,恭喜您,你的当前系统适合本软件的使用!";

  39}

  40rk.Close();

  41}

  42}

  43}

【获取当前操作系统的软件版本】相关文章:

php获取当前url地址的方法05-03

JavaScript如何获取获取当前年月日星期06-04

php获取当前时间的毫秒数详解02-16

Linux操作系统的十个经典版本08-01

C#检测操作系统版本的方法汇总07-15

php根据IP地址获取当前地理位置接口05-18

WindowsMobile操作系统手机版本分类对应机型01-26

初学者学习linux操作系统用什么版本02-02

适用于多条件筛选列表的PHP获取当前URL路径01-22