A
Alberto
I have this code to write a xml file:
public void Grabar()
{
SaveFileDialog sfd = new SaveFileDialog();
sfd.DefaultExt = "xml";
sfd.InitialDirectory = Config.Directory;
if (sfd.ShowDialog() == DialogResult.OK)
{
FileStream fs = new FileStream(sfd.FileName,
FileMode.Create);
XmlTextWriter tw = new XmlTextWriter(sfd.FileName, null);
<=====
tw.Formatting = Formatting.Indented;
tw.WriteStartDocument();
....
When I execute the code, it breaks in the selected line. It says that the
file it's been used by another process but the file it's new. I type a new
name in the filedialog form.
Thank you for your help.
public void Grabar()
{
SaveFileDialog sfd = new SaveFileDialog();
sfd.DefaultExt = "xml";
sfd.InitialDirectory = Config.Directory;
if (sfd.ShowDialog() == DialogResult.OK)
{
FileStream fs = new FileStream(sfd.FileName,
FileMode.Create);
XmlTextWriter tw = new XmlTextWriter(sfd.FileName, null);
<=====
tw.Formatting = Formatting.Indented;
tw.WriteStartDocument();
....
When I execute the code, it breaks in the selected line. It says that the
file it's been used by another process but the file it's new. I type a new
name in the filedialog form.
Thank you for your help.