c# - create directory error while not entering into if condition -


i have problem directory creation:

if (!directory.exists(directorypath)//here have problem not enter if contion  {     directory.createdirectory(directorypath);     clientscript.registerstartupscript(this.gettype(), "alert", "alert('successfully saved');", true); } else {     clientscript.registerstartupscript(this.gettype(), "alert", "alert('directory exists');", true); } 

can please ?

try {     if (!directory.exists(directorypath))     {         directory.createdirectory(directorypath);         clientscript.registerstartupscript(this,this.gettype(), "alert", "alert('successfully saved');", true);     }     else     {         clientscript.registerstartupscript(this,this.gettype(), "alert", "alert('directory exists');", true);     } } catch(exception ex) {     throw; } 

i believe have problem parenthesis on first line, , please make sure directorypath has valid path


Comments

Popular posts from this blog

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -

firemonkey - How do I make a beep sound in Android using Delphi and the API? -