Chia sẻ

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 !!!

 

 


Chia sẻ
Xem thêm  [C#] How to Delete a File in C#

Leave a Reply

Your email address will not be published.