Check whether a folder exists in a path in c#?

后端 未结 4 1518
南旧
南旧 2021-01-18 16:19

How to check whether a folder named RM exists inside a directory...I have given the directory path through textbox like txtBoxInput.Text and in thi

4条回答
  •  青春惊慌失措
    2021-01-18 16:46

    Path.Combine and Directory.Exists ?

    http://msdn.microsoft.com/en-us/library/system.io.path.combine.aspx

    http://msdn.microsoft.com/en-us/library/system.io.directory.exists.aspx

    if (Directory.Exists(Path.Combine(txtBoxInput.Text, "RM"))
    {
        // Do Stuff
    }
    

提交回复
热议问题