473,324 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Write OpenFileDialog.FileName to XML file

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,

David
Nov 12 '05 #1
2 2531
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,

David
Nov 12 '05 #2
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,

David
Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Koala Beer | last post by:
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...
2
by: Bonzo | last post by:
Hi, How do I simply open a text file into a textbox? I know that in C++ I'd use something like: if(OpenDialog1->Execute()) Memo1->Lines->LoadFromFile(OpenDialog1->FileName); How can I do it...
4
by: Nagachandra Sekhar Grandhi | last post by:
I am facing a problem with OpenFileDialog. It is as follows. I opened OpenFileDialog dialog box and selected a folder in it. After selecting the folder when i tried to delete the same folder in...
8
by: e-mid | last post by:
why does not openFileDialog have closed event? i want to do something; as soon as the dialog closes. is there a way to do this?
8
by: marcus.kwok | last post by:
I am having a weird problem and I have can't figure out why it is happening. I create an OpenFileDialog and set a filename filter. When the dialog first opens, the filter works correctly, and...
11
by: kimiraikkonen | last post by:
Hi, Vb.net 2005 express i've been working, the problem is: I use openfiledialog to browse files, i created some code to execute file with OK button, no problem. But if i press "cancel" button as...
6
by: SpreadTooThin | last post by:
After I select a file with the OpenFileDialog, I get the file name with .FileName, but I want to know the drive and path where that file is. What function, method, class can I use in C# to get the...
3
by: Tony Johansson | last post by:
Hello! The object called dlgOpenFile is of type OpenFileDialog. In this example the eventhandler OnFileOpen is called when the Open File in a menu is clicked. Here we call the OpenFileDialog...
2
by: Peted | last post by:
Hi i have a circumstance where a user unzips a file, with a certain layer of directories to get to a textfile. So in any directory on the HDD they may end up with something like ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.