43 lines
800 B
C#
43 lines
800 B
C#
using System;
|
|
using System.Windows.Forms;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.IO;
|
|
using System.Xml;
|
|
|
|
namespace XMLLoader
|
|
{
|
|
class xmlLoader
|
|
{
|
|
public String m_FileName;
|
|
XmlDocument m_xmlDocument;
|
|
XmlElement m_xmlDocumentElement;
|
|
|
|
public xmlLoader(String FileName)
|
|
{
|
|
if (!File.Exists(FileName))
|
|
{
|
|
MessageBox.Show("File not found.. : " + FileName);
|
|
return;
|
|
}
|
|
|
|
m_FileName = FileName;
|
|
|
|
m_xmlDocument = new XmlDocument();
|
|
m_xmlDocument.Load(m_FileName);
|
|
m_xmlDocumentElement = (XmlElement)m_xmlDocument.DocumentElement;
|
|
}
|
|
|
|
public XmlDocument GetDocument()
|
|
{
|
|
return m_xmlDocument;
|
|
}
|
|
|
|
public XmlElement GetElement()
|
|
{
|
|
return m_xmlDocumentElement;
|
|
}
|
|
}
|
|
}
|