Environment Variables for Simple Security Tasks : Environment Settings « Development Class « C# / C Sharp






Environment Variables for Simple Security Tasks

Environment Variables for Simple Security Tasks
    

using System;
namespace SimpleSecurity
{
  class Class1
  {
    [STAThread]
    static void Main(string[] args)
    {
      Console.WriteLine("I am currently running as:");
      Console.WriteLine("User   : {0}",Environment.UserName);
      Console.WriteLine("Domain : {0}",Environment.UserDomainName);
    }
  }
}

           
         
    
    
    
  








Related examples in the same category

1.Get Startup path, application name and vendorGet Startup path, application name and vendor
2..NET Frameworks Overview:Accessing Environment Settings.NET Frameworks Overview:Accessing Environment Settings
3.Environment.GetEnvironmentVariable
4.Environment.ExpandEnvironmentVariables
5.Environment.GetEnvironmentVariables(EnvironmentVariableTarget.Process)
6.Environment.CommandLine, Environment.GetCommandLineArgs()
7.Environment.GetFolderPath
8.Environment.SpecialFolder
9.Environment.CommandLine
10.Environment.OSVersion
11.Environment.Version
12.Environment.UserName
13.Environment.UserDomainName
14.Environment.MachineName
15.Environment.UserInteractive
16.Environment.HasShutdownStarted
17.Environment.TickCount
18.Environment.GetLogicalDrives
19.Environment.CurrentDirectory
20.Environment.SystemDirectory
21.Is 2003 Vista Or Greater
22.Environment Class
23.Gets the command line for this process.
24.Gets or sets the fully qualified path of the current working directory.
25.Terminates this process and gives the underlying operating system the specified exit code.
26.Gets or sets the exit code of the process.
27.Replaces the name of each environment variable embedded in string
28.Immediately terminates a process after writing a message to the Windows Application event log
29.Returns a string array containing the command-line arguments for the current process.
30.Retrieves the value of an environment variable from the current process.
31.Retrieves all environment variable names and their values from the current process.
32.Gets the path to the system special folder that is identified by the specified enumeration.
33.Get the names of the logical drives on the current computer.
34.Gets the NetBIOS name of this local computer.
35.Gets the newline string defined for this environment.
36.Gets current platform identifier and version number.
37.Gets the number of processors on the current machine.
38.Gets current stack trace information.
39.Gets the fully qualified path of the system directory.
40.Gets the number of milliseconds elapsed since the system started.
41.Gets network domain name associated with the current user.
42.Is running in user interactive mode.
43.Gets user name
44.Gets a Version object that describes the major, minor, build, and revision numbers of the common language runtime.
45.Gets the amount of physical memory mapped to the process context.
46.Xml based configuration
47.FindExecutable
48.Contains a listing of constants used throughout the application
49.Is Flag Set In the Command Line