This is a C# Program to create a directory.
Problem Description
This C# Program Creates a Directory.
Problem Solution
Here a new Directory is created in C directory using createdirectory function.
Program/Source Code
Here is source code of the C# Program to Create a Directory. The C# program is successfully compiled and executed with Microsoft Visual Studio. The program output is also shown below.
/* * C# Program to Create a Directory */ using System; using System.IO; class program { public static void Main() { Directory.CreateDirectory("C:\\NewDirectory"); Console.WriteLine("NewDirectory is Created in C Directory"); Console.ReadLine(); } }
Program Explanation
This C# program is used to create a directory. Here a new Directory is created in C directory using createDirectory() function.
advertisement
advertisement
Runtime Test Cases
NewDirectory is Created in C Directory
Sanfoundry Global Education & Learning Series – 1000 C# Programs.
If you wish to look at all C# Programming examples, go to 1000 C# Programs.
Next Steps:
- Get Free Certificate of Merit in C# Programming
- Participate in C# Programming Certification Contest
- Become a Top Ranker in C# Programming
- Take C# Programming Tests
- Chapterwise Practice Tests: Chapter 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
- Chapterwise Mock Tests: Chapter 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
Related Posts:
- Buy Computer Science Books
- Buy C# Books
- Practice MCA MCQs
- Apply for Computer Science Internship
- Buy MCA Books