本文整理汇总了C#中System.Xml.XmlTextReader.Skip方法的典型用法代码示例。如果您正苦于以下问题:C# System.Xml.XmlTextReader.Skip方法的具体用法?C# System.Xml.XmlTextReader.Skip怎么用?C# System.Xml.XmlTextReader.Skip使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Xml.XmlTextReader
的用法示例。
在下文中一共展示了System.Xml.XmlTextReader.Skip方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Get_Definephrase
public static string Get_Definephrase(string tag)
{
try
{
string ffile = "/cmm/xhtml/Definephrase.xml";
string fpath = HttpContext.Current.Server.MapPath(ffile);
if (!System.IO.File.Exists(fpath)) return "";
string vlreturn = "";
System.Xml.XmlTextReader rdr = new System.Xml.XmlTextReader(fpath);
while (rdr.Read())
{
switch (rdr.NodeType)
{
case System.Xml.XmlNodeType.Element:
if (rdr.Name == LANG + tag)
{
vlreturn = rdr.ReadElementString();
goto lexit;
}
else if (rdr.Name != "phrase")
rdr.Skip();
break;
default:
break;
}
}
lexit:
rdr.Close();
return vlreturn;
}
catch
{
return "Cannot get phrase";
}
}
示例2: AVI_XML
static Avi1MinXmlPackage AVI_XML(string extAvidevName, char centerCode)
{
Avi1MinXmlPackage ret=null;
System.Xml.XmlTextReader rd = new System.Xml.XmlTextReader("1min_avi_data.xml");
System.DateTime xmlfiledate;
while (rd.Read())
{
switch(rd.NodeType)
{
case System.Xml.XmlNodeType.Element:
Console.WriteLine(rd.Name);
if (rd.Name == "file_attribute")
{
Console.WriteLine(rd.GetAttribute("time"));
ret = new Avi1MinXmlPackage();
ret.datetime = System.Convert.ToDateTime(rd.GetAttribute("time"));
}
else
if (rd.Name == "avi_data")
{
if (rd.GetAttribute("eqId") != extAvidevName)
{
rd.Skip();
break;
}
Console.WriteLine("\t" + rd.GetAttribute("eqId"));
}
else if (rd.Name == "plateData")
{
Console.WriteLine("\t\t" + rd.GetAttribute("plateNo")+"\t"+rd.GetAttribute("catchTime"));
int catchSec=System.Convert.ToInt32(rd.GetAttribute("catchTime"));
ret.Items.Add(new RemoteInterface.MFCC.AVIPlateData(extAvidevName, ret.datetime.AddSeconds(catchSec), rd.GetAttribute("plateNo")));
}
break;
}
}
return ret;
}