Study notes, please correct me if you have any mistakes. The number is also please point out, thank you.
1Unity loading local XML file
XmlDocument.Load (" file absolute path ");
2Unity loading geo-XML files
Install a XAMPP on the local computer that integrates the Apache server and puts an XML file under the server (Apache files are placed under the Htdocs folder)
The XML content is as follows:
voidIsuserexist (stringNamestringpwd) {XmlElement root=Readxmlfile.getrootnode ();// for(inti =0; I < root. childnodes.count;i++) {XmlElement XE= (XmlElement) root. Childnodes[i];//The ChildNodes property returns the NodeList that contains the child nodes of the selected node if(name. Equals (XE. GetAttribute ("name")))//The Equals method compares the value, GetAttribute () Gets the value of the specified property{User=XE; } } if(user!=NULL) { if(pwd. Equals (user. GetAttribute ("Password")))//The Equals method compares the value, GetAttribute () Gets the value of the specified property{loginstr="Landing Success";//Prompt Informationisloginsucess=true;//Landing Success } Else{loginstr="Wrong password! "; Isloginsucess=false;//Login Failed } } Else{isloginsucess=false;//Login FailedLoginstr="no user"; } }
02 Operation xml-unity Loading XML file mode