How xml file is written?

Topics: Developer Forum, Localization Forum, Project Management Forum, User Forum
Apr 20, 2010 at 4:30 PM

please explain how the xml files r written for the relevant  operations? And where they r placed? and where the settings for that is available?

 

Apr 24, 2010 at 8:46 PM

Look at the code in \App_Code\Persistable.cs (v1.2 here)

Loading from XML in: protected void LoadData()

using (FileStream reader = File.Open(_path, FileMode.Open, FileAccess.Read, FileShare.ReadWrite))

{ XmlSerializer serializer = new XmlSerializer(typeof(T));_data = (T)serializer.Deserialize(reader); }

HttpContext.Current.Cache.Insert(_path, _data);

Saving to XML in: public void SaveData()

 using (FileStream writer = File.Create(_path))

{ XmlSerializer serializer = new XmlSerializer(typeof(T));serializer.Serialize(writer, _data); }

Apr 27, 2010 at 4:55 PM
Dear sir,

       Thank u very much... Am beginner to asp.net  .. Could u plese explain these piece of code sir... And also which type of security is given for this site sir? Is there u use tools like firewall etc.. Thanx in advance...
May 1, 2010 at 9:44 PM

I'm afraid that's a big question, beyond my available time.  I suggest you read the visual studio help files for these topics:

  • XMLSerializer
  • FileStream
  • File

Regards, Joe

May 2, 2010 at 6:03 AM
Thank u Sir...