Talking about XML usage in C #

xiaoxiao2021-03-06  118

I also just started XML, but I also want to share my own things to share a university. Please support it.

This is 001.xml file

INT FLAG = 0;

XmlTextReader objtxtrd = new xmlTextReader (StrfilePath);

While (Objtxtrd.Read ())

{

IF (objtxtrd.nodetype = xmlnodetype.eray)

{

IF (objtxtrd.hasettributes)

{

Objtxtrd.movetoAttribute ("NUM");

IF (Objtxtrd.Value == TextBox1.text)

{Flag = 1; MessageBox.show ("Find success"; Break;}

}

}

}

IF (Flag == 0) {MessageBox.show ("Without this person, please sure to enter.");

If you have Chinese characters in your document, please remember to pay attention to the form of UTF-8 when you will save, otherwise I will not want me.

转载请注明原文地址:https://www.9cbs.com/read-99379.html

New Post(0)