How to check if a Folder exists in Computer desktop from C#? -


I need to check weather: A folder is in the desktop computer with C # C: \\ User \\ MyComputer \ \ Desktop \\ Test . If I do not exist then I have to add a folder test

I have a folder test

  string desktoppath = environment. GatefolderPath (environment specialfolder.desktop directory) is the code to make; System.IO.Directory.CreateDirectory (desktoppath + "\\ test");   

But before that I have to check whether the folder exists or not. How to check with C # Help me fulfill this task.

Thanks in advance.

I think you are looking for

< pre> if (! directory.exist (path.cobine (desktoppath, "test")) {// directory does not exist}

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -