示例#1
0
        SnoopXML()
        {
            System.Windows.Forms.OpenFileDialog dbox = new System.Windows.Forms.OpenFileDialog();
            dbox.CheckFileExists = true;
            dbox.AddExtension    = true;
            dbox.DefaultExt      = "xml";
            dbox.Filter          = "XML Files (*.xml)|*.xml";
            dbox.Multiselect     = false;
            dbox.Title           = "Select an XML file";

            if (dbox.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument();
                    xmlDoc.Load(dbox.FileName);

                    Xml.Forms.Dom form = new Xml.Forms.Dom(xmlDoc);
                    form.ShowDialog();
                }
                catch (System.Xml.XmlException e)
                {
                    MessageBox.Show(e.Message, "XML Exception");
                }
            }
        }
        public void SnoopXML()
        {
            System.Windows.Forms.OpenFileDialog dbox = new System.Windows.Forms.OpenFileDialog();
             dbox.CheckFileExists = true;
             dbox.AddExtension = true;
             dbox.DefaultExt = "xml";
             dbox.Filter = "XML Files (*.xml)|*.xml";
             dbox.Multiselect = false;
             dbox.Title = "Select an XML file";

             if (dbox.ShowDialog() == DialogResult.OK)
             {
            try
            {
               System.Xml.XmlDocument xmlDoc = new System.Xml.XmlDocument();
               xmlDoc.Load(dbox.FileName);

               Xml.Forms.Dom form = new Xml.Forms.Dom(xmlDoc);
               form.ShowDialog();
            }
            catch (System.Xml.XmlException e)
            {
               MessageBox.Show(e.Message, "XML Exception");
            }
             }
        }