コード例 #1
0
        /// <summary>GetServicePack</summary>
        /// <remarks>http://support.microsoft.com/?kbid=304721</remarks>
        public static string GetServicePack()
        {
            string        servicePack = "No Service Pack Installed";
            OSVERSIONINFO os          = new OSVERSIONINFO();

            os.dwOSVersionInfoSize = Marshal.SizeOf(typeof(OSVERSIONINFO));
            GetVersionEx(ref os);
            if (os.szCSDVersion != "")
            {
                servicePack = os.szCSDVersion;
            }
            return(servicePack);
        }
コード例 #2
0
 ///<summary>GetVersionEx</summary>
 [DllImport("kernel32.Dll")] public static extern short GetVersionEx(ref OSVERSIONINFO o);