C
Chris
Hi,
In C# I tried to save a file from a generated file name.
Just before launching the dialog I check for a valid file
name to be sure.
There for I used the method ValidateNames from the save
dialog.
The strange thing is that sometimes the save dialogue
crashes on invalid file names (containing chars like ] ),
but the method ValidateNames return true.
Code looks like:
saveFileDialog = new System.Windows.Forms.SaveFileDialog();
saveFileDialog.FileName = (...) <--- generated file name
may contan invalid chars
if (!saveFileDialog.ValidateNames) <-- method returns true
for invalid file names ??
{
saveFileDialog.FileName =
"MyChart."+saveFileDialog.DefaultExt; <-- if name is
invalid, supply valid file name as default
}
if (saveFileDialog.ShowDialog() == DialogResult.OK)
{
}
Any idea what may be wrong ?
Thanks.
Bye
Chris
In C# I tried to save a file from a generated file name.
Just before launching the dialog I check for a valid file
name to be sure.
There for I used the method ValidateNames from the save
dialog.
The strange thing is that sometimes the save dialogue
crashes on invalid file names (containing chars like ] ),
but the method ValidateNames return true.
Code looks like:
saveFileDialog = new System.Windows.Forms.SaveFileDialog();
saveFileDialog.FileName = (...) <--- generated file name
may contan invalid chars
if (!saveFileDialog.ValidateNames) <-- method returns true
for invalid file names ??
{
saveFileDialog.FileName =
"MyChart."+saveFileDialog.DefaultExt; <-- if name is
invalid, supply valid file name as default
}
if (saveFileDialog.ShowDialog() == DialogResult.OK)
{
}
Any idea what may be wrong ?
Thanks.
Bye
Chris