[C#] How to Get and Set Current Directory in C#

Hello friends !

Now, we will learn How to Get and Set Current Directory in C#.

The SetCurrentDirectory method sets the specified directory as the current directory. The GetCurrentDirectory method returns the current directory.

string root = @"C:\Temp";
Directory.SetCurrentDirectory(root);
Console.WriteLine(Directory.GetCurrentDirectory());

I wish you success, please leave a comment below, we will answer all your questions.

GoodLuck !!!

 

 

Xem thêm  [C#] How to Creating a Dictionary

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *