c# - Error at checking if directory exists | compiler says directory not found -
i wanted make short programme looks if specific directory exists. if not, should second directory. if doesn't exist first one, should third directory, , on.
here's code.
the compiler says @ starting program: part of path "c:\program files\gameforgelive" couldn't found.
but program should skip path if doesn't exist.
do have advices?
my check-if-directory-exists-method:
if (!directory.exists(newclientgame)) { system.io.directory.delete(newclientgame, true); } else { system.console.writeline("wait.."); }
if wouldn't mind, copy paste of code question. suggest (since won't click link at, i'm not sure if you're doing already), use:
if(!directory.exists("your path")
post code here , can maybe provide better solution if using. post describes user problem. stackoverflow question
edit...
if (!directory.exists(newclientgame)) { system.io.directory.delete(newclientgame, true); }
this if statement says, if directory specified path "newclientgame" not exist, should delete it. sure functionality want? might late me thinking logically feel have backwards. think want.
if(directory.exists(newclientgame)) { // delete directory }
Comments
Post a Comment