File Path in XML

DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 7 of 7

Thread: File Path in XML

  1. #1
    Join Date
    Apr 2004

    File Path in XML

    Hi all,

    I'm creating a progam in C# that reads a file location at start up and displays the parent folders in a combo box. This file location may change in future. So I intend to keep this in an xml file and allow the user to change it when needed. But how do I go about it? I have not done any coding with xml yet. So, please help.


  2. #2
    Join Date
    Apr 2007
    Sterling Heights, Michigan
    An XML file is nothing more that a specially formatted text file.

    Have you worked with text files before?
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  3. #3
    Join Date
    Apr 2004
    Not really! Could you help me out please?

  4. #4
    Join Date
    Jan 2009
    Check out these following links

    If you can provide more details as to the format of the file and the purpose of the app I might be able to help futher...what you have said is a bit vague and doesn't make a lot of sense to me!

  5. #5
    Join Date
    Apr 2004
    Quote Originally Posted by Hack View Post
    An XML file is nothing more that a specially formatted text file.

    Have you worked with text files before?
    Yes, I have worked. I came to know that the properties settings would do the job. But that too gives an error.

    I added 'ParentPath' in the Name field and "C:\Test" in the value field. But the error is 'Illegal characters in path.'

    string path = Properties.Settings.Default.ParentPath.ToString();
    DirectoryInfo di = new DirectoryInfo(path);

  6. #6
    Join Date
    Jan 2009
    It sounds like you havent escaped the \

    \ is a special character and as such needs to be escaped using another \

    so use something like

    string test = "C:\\test.txt"

    string test = @"C:\test.txt"

  7. #7
    Join Date
    Apr 2004
    Solved by removing the quotes.

Similar Threads

  1. XML files vs Database
    By Mansoor in forum XML
    Replies: 8
    Last Post: 08-23-2002, 04:35 PM
  2. File uploading / objFile.Write problem
    By Tomer Cagan in forum ASP.NET
    Replies: 1
    Last Post: 07-24-2001, 09:01 AM
  3. How do i search within a xml file?
    By Kelvin Teh in forum XML
    Replies: 3
    Last Post: 02-16-2001, 10:09 AM
  4. Display xml file
    By rana in forum XML
    Replies: 5
    Last Post: 12-09-2000, 11:50 PM
  5. Problem Converting ADO Recordset to XML
    By CHRISTOS STAVRINOU in forum VB Classic
    Replies: 0
    Last Post: 11-16-2000, 04:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center