I've made a button so when I click it, it opens up a directory from which I can create a text file, I click the button, it opens the directory fine, I can name the text file what I want and click save, but then I get an error saying "An unhandled exception of type 'System.ArgumentException' occurred in mscorlib.dll"
This is my code:
private void createAlgorithmsAndComplexityNotesToolStripMenuItem_Click(object sender, EventArgs e)
{
SaveFileDialog sfd = new SaveFileDialog();
sfd.Filter = "Text File|*.txt";
sfd.FileName = "Algorithms And Complexity Lecture Notes";
sfd.Title = "Algorithms And Complexity Lecture Notes";
if (sfd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
string path = sfd.FileName;
StreamWriter write = new StreamWriter(File.Create("C:\\Users\antho\\Desktop\\Folder\\Uni\\Programming and data structures\\Assignment 2\\Modules"));
write.Write(writeFile);
write.Close();
}
}