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
Post a Comment