Atlanta Custom Software Development 

 
   Search        Code/Page
 

User Login
Email

Password

 

Forgot the Password?
Services
» Web Development
» Maintenance
» Data Integration/BI
» Information Management
Programming
  Database
Automation
OS/Networking
Graphics
Links
Tools
» Regular Expr Tester
» Free Tools

Retrieve Windows and System directories

Total Hit ( 3248)

Rate this article:     Poor     Excellent 

 Submit Your Question/Comment about this article

Rating


 


In VB.NET you don't need to call the GetWindowsDirectory and GetSystemDirectory API functions to retrieve the path the Windows and System directories. Retrieving the System directory is as simple as calling the Environment.SystemDirectory property:

Click here to copy the following block
Dim sysDir As String = Environment.SystemDirectory()

The Environment class doesn't expose any property that returns the Windows directory; however, it is simple to extract the first portion of the system directory's path, by using the GetDirectoryName method of the System.IO.Path class:

Click here to copy the following block
Dim winDir As String = System.IO.Path.GetDirectoryName _
  (Environment.SystemDirectory)

Alternatively, you can retrieve the Windows directory by reading the WINDIR environment variable:

Click here to copy the following block
winDir = Environment.GetEnvironmentVariable("WINDIR")


Submitted By : Nayan Patel  (Member Since : 5/26/2004 12:23:06 PM)

Job Description : He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting.
View all (893) submissions by this author  (Birth Date : 7/14/1981 )


Home   |  Comment   |  Contact Us   |  Privacy Policy   |  Terms & Conditions   |  BlogsZappySys

© 2008 BinaryWorld LLC. All rights reserved.