Check if a folder exist in a directory and create them using C#

前端 未结 7 855
青春惊慌失措
青春惊慌失措 2020-12-01 02:44

How can I check if directory C:/ contains a folder named MP_Upload, and if it does not exist, create the folder automatically?

I am using V

7条回答
  •  萌比男神i
    2020-12-01 02:57

    if(!System.IO.Directory.Exists(@"c:\mp_upload"))
    {
         System.IO.Directory.CreateDirectory(@"c:\mp_upload");
    }
    

提交回复
热议问题