Difference between revisions of "Check to see if a Directory Exists in C Sharp"

From RiceFamily Wiki
Jump to: navigation, search
(Created page with "string path = @"C:\MP_Upload"; if(!Directory.Exists(path)) :{ ::Directory.CreateDirectory(path); :}")
 
 
Line 1: Line 1:
 
string path = @"C:\MP_Upload";
 
string path = @"C:\MP_Upload";
 +
 
if(!Directory.Exists(path))
 
if(!Directory.Exists(path))
 
:{
 
:{
 
::Directory.CreateDirectory(path);
 
::Directory.CreateDirectory(path);
 
:}
 
:}

Latest revision as of 19:56, 12 April 2015

string path = @"C:\MP_Upload";

if(!Directory.Exists(path))

{
Directory.CreateDirectory(path);
}