Write List of Files in Directory to XML File

Results 1 to 2 of 2

Thread: Write List of Files in Directory to XML File

  1. #1
    Join Date
    Dec 1969

    Default Write List of Files in Directory to XML File

    &#060;intro&#062;I mostly use ASP/VBScript/MSAccess, but for my next project would like to use ASP.NET/VB/XML for the first time. If you disagree that XML should be used in this case please let me know. Thanks...Keith&#060;/intro&#062;<BR>&#060;AlreadyDone&#062;I used the Directory.GetFiles Method to grab a list of files in a certain folder.&#060;/AlreadyDone&#062;<BR>&#060;Stumped&#062;The first time the page is accessed I would like to create the xml file and store the file name and a blank comment for each file. Then I would like to display the file name (with a link) with a text box next to each file name. The text box will hold the comment for that file (currently blank).<BR>The next time the page is accessed I would like to remove files from the list that are no longer in the specified folder and add any new files to the list.<BR>At this point I want to give the user the ability to type in comments for any or all files and then after a Submit button is clicked write that data back to the xml file.<BR>Seems simple enough, but I don&#039;t know too much about writing and reading XML files.<BR>I don&#039;t want to simply delete and then recreate the xml file everytime the page is loaded because I want to retain the comments.&#060;/Stumped&#062;Thanks in advance for nay help that you can offer. Also, if I&#039;m going against proper ettiquette on this board and asking too much....my apologies.

  2. #2
    Join Date
    Dec 1969

    Default So what does...

    ...the XML file you are creating, so far, look like?<BR><BR>It does occur to me that a different/better(?) way to do this would be to create a DataTable with the info in it and save that to the database. Or, I suppose, you could simply use WriteXML method on the DataTable to create the XML. Then you can use ReadXML to read it back in. And now you can very easily bind the DataTable to a DataGrid for easy viewing and editing. [Though you are also supposed to be able to bind an XML source to a DataGrid, I *think*. Never done it myself.]<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts