Hi,
Am trying to save resource file to any directory but it is throwing an error. It says, Verify that the correct file name was given.
here is my codding,
string PathSelection = "";
SaveFileDialog saveFileDialog1 = new SaveFileDialog();
saveFileDialog1.Title = "Save Resource Files";
saveFileDialog1.Filter = "Save Resource Files (*.resx)|*.resx";
saveFileDialog1.FilterIndex = 1;
saveFileDialog1.RestoreDirectory = true;
if (saveFileDialog1.ShowDialog() == DialogResult.OK) //it breaks on this line
{
string path = saveFileDialog1.FileName;
//oDataSet.WriteXml(path);
}
2 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Pranay RanaPosted Feb 9, 2015, 6:53 AM
so add property than try
SaveFileDialog1.InitialDirectory = @"C:\";
SaveFileDialog1.CheckFileExists = true;
SaveFileDialog1.CheckPathExists = true;
EnosPosted Feb 9, 2015, 7:01 AM