Groups | Blog | Home
all groups > dotnet xml > june 2004 >

dotnet xml : Write OpenFileDialog.FileName to XML file


Koala Beer
6/21/2004 4:13:47 PM
Hi,

Here is something I can't figure out what I am doing wrong:

I use a OpenFileDialog to select a file. I put the result string from
the FileName property in a textbox on my form. Later on I save the
..Text property to an xml file. Nothing happens, the filename is not
writen to the xml file, and there is no exception.

When I replace the OpenFileDialog with a FolderBrowserDialog and I
copy the SelectedPath string to the textbox, and save it to the xml
file everything works fine.

Is there a difference between the both? They should both be a string.
When I debug the application I can see them both apear as string
literals.

I you can help me out on this one that would be great!

regards,

Koala Beer
6/21/2004 5:12:43 PM
Just in case you want to react to this question, I allready found out
what I was doing wrong. And I am not proud of it...

It has got nothing to do with the dialogs.

I didn't realise that when using the filedialog the default directory
is also changing, so when I write the xml, is ends up in the wrong
directory. When I read back the xml from the home directory of my
application it looks as if nothing has been written.

How stupid can one be!

regards,

AddThis Social Bookmark Button