//---------------------------------------------------------------------------- // Copyright (C) 2013-2015 Fabrice HARROUET (ENIB) // // Permission to use, copy, modify, distribute and sell this software // and its documentation for any purpose is hereby granted without fee, // provided that the above copyright notice appear in all copies and // that both that copyright notice and this permission notice appear // in supporting documentation. // The author makes no representations about the suitability of this // software for any purpose. // It is provided "as is" without express or implied warranty. //---------------------------------------------------------------------------- using System; using System.Collections; public class Test { public static void Main(string[] args) { Type t=Type.GetType("Mono.Runtime"); if(t!=null) { Console.WriteLine("Mono detected"); } else { Console.WriteLine("No Mono detected, probably .NET?"); } Console.WriteLine("CommandLine: {0}", Environment.CommandLine); Console.WriteLine("CurrentDirectory: {0}", Environment.CurrentDirectory); #if false // not available under Mono Console.WriteLine("CurrentManagedThreadId: {0}", Environment.CurrentManagedThreadId); #endif Console.WriteLine("ExitCode: {0}", Environment.ExitCode); Console.WriteLine("HasShutdownStarted: {0}", Environment.HasShutdownStarted); Console.WriteLine("Is64BitOperatingSystem: {0}", Environment.Is64BitOperatingSystem); Console.WriteLine("Is64BitProcess: {0}", Environment.Is64BitProcess); Console.WriteLine("MachineName: {0}", Environment.MachineName); Console.WriteLine("NewLine: {0}", Environment.NewLine); Console.WriteLine("OSVersion: {0}", Environment.OSVersion); Console.WriteLine("ProcessorCount: {0}", Environment.ProcessorCount); Console.WriteLine("StackTrace: {0}", Environment.StackTrace); Console.WriteLine("SystemDirectory: {0}", Environment.SystemDirectory); Console.WriteLine("SystemPageSize: {0}", Environment.SystemPageSize); Console.WriteLine("TickCount: {0}", Environment.TickCount); Console.WriteLine("UserDomainName: {0}", Environment.UserDomainName); Console.WriteLine("UserInteractive: {0}", Environment.UserInteractive); Console.WriteLine("UserName: {0}", Environment.UserName); Console.WriteLine("Version: {0}", Environment.Version); Console.WriteLine("WorkingSet: {0}", Environment.WorkingSet); Console.WriteLine("GetCommandLineArgs():"); foreach(string i in Environment.GetCommandLineArgs()) { Console.WriteLine(" --> {0}",i); } Console.WriteLine("GetEnvironmentVariables():"); foreach(DictionaryEntry i in Environment.GetEnvironmentVariables()) { Console.WriteLine(" --> {0}={1}",i.Key,i.Value); } Console.WriteLine("GetLogicalDrives():"); foreach(string i in Environment.GetLogicalDrives()) { Console.WriteLine(" --> {0}",i); } } } //----------------------------------------------------------------------------