Click here to Skip to main content
Click here to Skip to main content
Articles » Languages » C# » Applications » Downloads
 
Add your own
alternative version

CooksMate

, 21 Jan 2008 GPL3
A simple program to help get the timing of a roast dinner
cooksmate-bin-mono.zip
cooksmate-bin-mono
CooksMate
mono
cooksmate.exe
cooksmate.exe.mdb
cooksmate.sh
log4net.dll
uk.org.aspellclark.common.dll
uk.org.aspellclark.common.gui.dll
cooksmate-bin-net.zip
cooksmate-bin-net
CooksMate
bin
Debug
cooksmate.exe
cooksmate.log
log4net.dll
uk.org.aspellclark.common.dll
uk.org.aspellclark.common.gui.dll
cooksmate-src.zip
cooksmate-src
Common
common.build
Properties
src
main
csharp
NotImplementedDlg.resources
CommonFile
common.file.build
CommonGui
common.gui.build
CooksMate
cooksmate.build
cooksmate.sh
cooksmate_norm.png
DlgAction.resources
DlgEditRecipe.resources
MainForm.resources
libs
mono
log4net.dll
Mono.GetOptions.dll
sqlite-3.5.4.so
net
log4net.dll
Mono.GetOptions.dll
sqlite3.def
sqlite3.dll
/*
 * Created by SharpDevelop.
 * User: andy
 * Date: 01/01/2008
 * Time: 13:51
 * 
 * To change this template use Tools | Options | Coding | Edit Standard Headers.
 */

using System;

namespace uk.org.aspellclark.common
{
	/// <summary>
	/// Description of SystemInfo.
	/// </summary>
	public class SystemInfo
	{
		// Create a logger for use in this class
		private static readonly log4net.ILog log = log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

		
		public static string CurrentUsername
		{
			get {return System.Windows.Forms.SystemInformation.UserName;}
		}

		public static string CurrentHostname
		{
			get {return System.Windows.Forms.SystemInformation.ComputerName;}
		}

		
        public static string OsVersion
        {
            get
            {
        		//return Environment.OSVersion.Platform + ":" + Environment.OSVersion.Version; 

        		log.Info(String.Format("Environment.OSVersion [{0}]", Environment.OSVersion));
				log.Info(String.Format("Environment.OSVersion.Platform [{0}]", Environment.OSVersion.Platform));
				log.Info(String.Format("Environment.OSVersion.Version [{0}]", Environment.OSVersion.Version));
				//log.Info(String.Format("Environment.OSVersion.VersionString [{0}]", Environment.OSVersion.VersionString));
				//log.Info(String.Format("Environment.OSVersion.ServicePack [{0}]", Environment.OSVersion.ServicePack));

				switch (Environment.OSVersion.Platform)
				{
				//#ifdef _NET_2_0
					case PlatformID.Unix:
					{
						return "unix";
					}
				//#endif
					case PlatformID.Win32S:
					{
						return "Win 3.1";
					}
					case PlatformID.Win32Windows:
					{
						switch (Environment.OSVersion.Version.Minor)
						{
						case 0:
							{
								return "Win95";
							}
						case 10:
							{
								return "Win98";
							}
						case 90:
							{
								return "WinME";
							}
						default:
							{
								return "Unknown";
							}
						}
					}
					case PlatformID.Win32NT:
					{
						switch (Environment.OSVersion.Version.Major)
		        		{
							case 3:
			                {
			                    return "NT 3.51";
			                }
			               case 4:
			                {
			                    return "NT 4.0";
			                }
							case 5:
		        			{
								return WinNtVersion();
			                }
						}
						break;
					}
	                case PlatformID.WinCE:
					{
						return "Win CE";
					}
				}
				return "Unknown";
			}
		}

        public static string WinNtVersion()
        {
        	switch (Environment.OSVersion.Version.Minor)
            {
            	case 0:
                {
                    return "Win2000";
                }
               case 1:
                {
                    return "WinXP";
                }
               case 2:
                {
                    return "Win2003";
                }
        		default:
    			{
    				return "unknown";
    			}
            }
        }

        public static string OsHostname
        {
            get { return Environment.MachineName; }
        }


        public static string MyDocumentsPath
        {
            get { return Environment.GetFolderPath(Environment.SpecialFolder.Personal); }
        }


    	
	}//class
}//namespace

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)

Share

About the Author

Andy Aspell-Clark
Software Developer (Senior) Airbus Defense and Space
United Kingdom United Kingdom
No Biography provided
Follow on   Twitter   LinkedIn

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.141223.1 | Last Updated 21 Jan 2008
Article Copyright 2007 by Andy Aspell-Clark
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid