here\'s my code
private void make_Book(int x, int y, string name)
{
#region Creating Book
// this code is initializing the book(button)
Button b
This is a sample of how to save load xml.
public static void Save(string x, string y, string name)
{
if (!Directory.Exists(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\appName"))
{
Directory.CreateDirectory(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\appName");
}
XmlDocument xmlDocument = new XmlDocument();
string xml = string.Format(@"", x, y, name);
xmlDocument.LoadXml(xml);
xmlDocument.Save(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\appName\\button.xml");
}
public static Dictionary Load()
{
string address = "";
if (!File.Exists(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\appName\\button.xml"))
{
return new Dictionary(){{"x",""},{"y",""},{"name",""}};
}
XmlDocument xmlDocument = new XmlDocument();
xmlDocument.Load(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\appName\\button.xml");
XmlNode button = xmlDocument.GetElementsByTagName("button").Item(0);
XmlNode nameNode = button.SelectSingleNode("name");
XmlNode xNode = button.SelectSingleNode("x");
XmlNode yNode = button.SelectSingleNode("y");
return new Dictionary() { { "name", nameNode.InnerText }, { "x", xNode.InnerText }, { "y", yNode.InnerText } };
}