![](https://tech.mychma.com/wp-content/uploads/2022/05/hukidashi3_komaru-1.png)
フォルダを新規作成するにはどうしたらいいですか?
![](https://tech.mychma.com/wp-content/uploads/2022/05/hukidashi1_normal.png)
![](https://tech.mychma.com/wp-content/uploads/2022/05/hukidashi1_normal.png)
![](https://tech.mychma.com/wp-content/uploads/2022/05/hukidashi1_normal.png)
フォルダの作成は、CreateDirectoryメソッドを使います。
目次
フォルダを新規作成する
DirectoryクラスのCreateDirectoryメソッドを利用することで、新しいフォルダーを作成することができます。引数には、作成フォルダのパスを指定します。
戻り値は、作成したフォルダのDirectoryInfoオブジェクトを返します。
System.IO.Directory.CreateDirectory(フォルダパス)
var ret = System.IO.Directory.CreateDirectory(@"C:\debug3");
Debug.WriteLine(ret.FullName);
Dim ret = System.IO.Directory.CreateDirectory("C:\debug3")
Debug.WriteLine(ret.FullName)
CHECK
DirectoryInfoオブジェクトのCreateSubdirectoryメソッドを利用することでもフォルダを作成できます。
コメント