try to open the xml in the browser to make sure it is a valid xml file,XmlDocument xmlDoc=new XmlDocument(); System.IO.StreamReader sr = new System.IO.StreamReader("bookstore.xml", System.Text.Encoding.GetEncoding("GB2312")); xmlDoc.Load(sr); sr.Close();
System.IO.StreamReader sr = new System.IO.StreamReader("bookstore.xml", System.Text.Encoding.GetEncoding("GB2312"));
xmlDoc.Load(sr);
sr.Close();