Click here to Skip to main content
15,867,568 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
when i have entered a data into xml file using web page or from outside at that time xml file need to reload it.

I want to know how can i automatically reload the xml file while i have entered data from web page or from another page.

What I have tried:

This is my xml page

<?xml version="1.0" standalone="yes"?>
<Advertisements>
  <Ad>
    <ImageUrl>https://image.freepik.com/free-vector/abstract-colorful-sales-background-concept_52683-32614.jpg</ImageUrl>
    <NavigateUrl>http://www.facebook.com</NavigateUrl>
    <AlternateText>please visit facebook.com</AlternateText>
    <Impressions>80</Impressions>
    <Keyword>fb</Keyword>
    <area>Header</area>
  </Ad>
  <Ad>
    <ImageUrl>~/admages/magnifying-glass-76520_1280.png</ImageUrl>
    <NavigateUrl>http://www.google.com</NavigateUrl>
    <AlternateText>please visit google.com</AlternateText>
    <Impressions>50</Impressions>
    <Keyword>fb</Keyword>
    <area>Body</area>
  </Ad>
</Advertisements>
Posted
Updated 8-Apr-20 2:58am
Comments
DerekT-P 8-Apr-20 8:35am    
"reload" it into what??

1 solution

If you're talking about reloading it into a desktop application, you set up a FileSystemWatcher object that reacts to changes to the desired file. Alternatively, you could create a thread that does something similar (I would do it this way because FileSystemWatcher seems to fire several events when a file changes.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900