I’m gettign the error: Error 2 Only assignment, call, increment, decrement, and new object expressions can be used as a statement.
Here is the code:
string masterdin = (@"K:\Drams\Cluse\" +"\\"+"Aia_Gn"+"\\"+Environment.UserName+"\\"+textBox1.Text);
if(Directory.Exists(masterdin))
{
MessageBox.Show("This Export set already exists, please rename your Export set");
textBox1.Clear();
}
else(System.IO.Directory.CreateDirectory(masterdin));
The error exists on this line : else(System.IO.Directory.CreateDirectory(masterdin));
Can someone point out how to make this work?
Don’t put parenthesis around the CreateDirectory (the edited version in this post fixes that issue).