zoukankan      html  css  js  c++  java
  • 检测本机是否安装iis,netFramework,ASPNET

      //判断是否已经安装iis
            public static bool ExistSqlServerService(string tem)
            {
                bool ExistFlag = false;
                ServiceController[] service = ServiceController.GetServices();
                for (int i = 0; i < service.Length; i++)
                {
                    if (service[i].ServiceName.ToString() == tem)
                    {
                        ExistFlag = true;
                    }
                }
                return ExistFlag;
            }
      }
            //判断是否安装netFramework
            private static bool GetDotNetVersions()
            {
                bool result = false;
                DirectoryInfo[] directories = new DirectoryInfo(
                    Environment.SystemDirectory + @"..Microsoft.NETFramework").GetDirectories("v?.?.*");
                //string list = "";
                foreach (DirectoryInfo info2 in directories)
                {
                    //list +=info2.Name.Substring(0,4)+",";
                    if (info2.Name.Substring(0, 4) == "v3.5")
                    {
                        result = true;
                    }
    
                }
                return result;
            }
     //检测是否安装ASPnet,通过注册表
                string value = Registry.GetValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\InetStp\Components", "ASPNET", null).ToString();
             if (value != null )
                {
                    label12.Text += ",ASPNET已安装";
                }
  • 相关阅读:
    分组声明
    描述项目的典型用户与场景
    用户调研
    10-11-12
    Sprint--5.21
    Cosplay之孩子的妈咪
    作业5.1之5.2
    51nod 1393 1393 0和1相等串
    51nod 1090 3个数和为0(排序+二分)
    51nod 1095 Anigram单词(map的使用)
  • 原文地址:https://www.cnblogs.com/provedl/p/14468328.html
Copyright © 2011-2022 走看看