Results 1 to 3 of 3

Thread: Get System Directory [URGENT]

  1. #1

    Thread Starter
    Frenzied Member usamaalam's Avatar
    Join Date
    Nov 2002
    Location
    Karachi
    Posts
    1,308

    Get System Directory [URGENT]

    Hi all,

    I need to get the system of directory with the help of C#, means if windows is installed in C Drive in windows folder, then I need to get c:\windows and so on.

    Thanks.

  2. #2
    Frenzied Member dynamic_sysop's Avatar
    Join Date
    Jun 2003
    Location
    Ashby, Leicestershire.
    Posts
    1,142

    Re: Get System Directory [URGENT]

    like this ...
    VB Code:
    1. string system32 = Environment.GetFolderPath(Environment.SpecialFolder.System);
    2.     Console.WriteLine("the System32 folder is located at :- " + system32);
    3.     string windows = system32.Substring(0 , system32.LastIndexOf(@"\"));
    4.     Console.WriteLine("the Windows folder is located at :- " + windows);
    ~
    if a post is resolved, please mark it as [Resolved]
    protected string get_Signature(){return Censored;}
    [vbcode][php] please use code tags when posting any code [/php][/vbcode]

  3. #3

    Thread Starter
    Frenzied Member usamaalam's Avatar
    Join Date
    Nov 2002
    Location
    Karachi
    Posts
    1,308

    Re: Get System Directory [URGENT]

    Thank you very much for your quick reply. I dont have VS .NET this time, tomorrow I will check it in office.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width