Identifying the Challenges of Team Development

System.Environment

Visual Basic .NET includes a class that provides information related to the current environment: System.Environment. This class encapsulates information that you used to have to obtain from different sources in previous versions of Visual Basic. For example, System.Environment can return the user's System folder, which used to require an API call, as well as the current directory, which used to be obtained from the Common File Dialog control. Table 12-5 lists the most commonly called members of System.Environment. A number of the directives in this chapter rely on information supplied by System.Environment.

 

Table 12-5. Useful Members of System.Environment 

Member

Description

CommandLine

Returns the command line arguments for the process

CurrentDirectory

Gets and sets the fully qualified path of the current directory

MachineName

Gets the NetBIOS name of the computer

OSVersion

Gets an OperatingSystem object that contains the current platform identifier and version number

StackTrace

Gets the current stack trace information

SystemDirectory

Gets the fully qualified path of the system directory

UserDomainName

Gets the network domain name associated with the current user

UserName

Gets the user name of the person who started the current thread

Version

Gets a Version object that describes the major, minor, build, and revision numbers of the common language runtime

WorkingSet

Gets the amount of physical memory mapped to the process context

GetEnvironmentVariable

Returns the value of the specified environment variable

GetEnvironmentVariables

Returns all environment variables and their values

GetLogicalDrives

Returns an array of strings containing the names of the logical drives on the current computer

 

Note

GetEnvironmentVariable, GetEnvironmentVariables, and GetLogicalDrives are methods. All other members listed in Table 12-5 are properties.


 

 

Goals of File Operations

The goals of performing file operations include

  • Performing efficient file operations.

  • Following standard conventions, such as saving temporary files in the user's temporary folder and making use of the user's My Documents folder.

  • Avoiding pathing issues when distributing a program.

 



Practical Standards for Microsoft Visual Basic. NET
Practical Standards for Microsoft Visual Basic .NET (Pro-Developer)
ISBN: 0735613567
EAN: 2147483647
Year: 2005
Pages: 84

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net