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

timeout - Handshake_timeout on RabbitMQ using python and pika from remote vm -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

c# - Search and Add Comment with OpenXML for Word -