- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
C# Program to create new directories
Use the CreateDirectory method to create a directory.
Let’s say you need to create a directory in D drive. For that, use the CreateDirectory() method as shown below −
Directory.CreateDirectory("D:\Tutorial");
The following is the code −
Example
using System.IO; using System; public class Program { public static void Main() { Directory.CreateDirectory("D:\Tutorial"); } }
Advertisements