读XML 的方式 。NET

前端之家收集整理的这篇文章主要介绍了读XML 的方式 。NET前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
XmlDocumentxmlDoc= new @H_301_5@XmlDocument();
@H_301_5@xmlDoc.Load( "titles.xml" @H_301_5@);
XmlNodexn=xmlDoc.SelectSingleNode( "items" @H_301_5@);
XmlNodeListxnl=xn.ChildNodes;
foreach @H_301_5@(XmlNodexnf in @H_301_5@xnl)
{
XmlElementxe=(XmlElement)xnf;
Console.Write( "类别" @H_301_5@+xe.GetAttribute( )+ "品质" @H_301_5@); //显示属性
Console.WriteLine(xe.GetAttribute( ));
XmlNodeListxnf1=xe.ChildNodes;
(XmlNodexn2 xnf1)
{
Console.WriteLine(xn2.InnerText); //显示子节点点文本
}
Console.WriteLine();
}

myWebClient.DownloadFile(NewUri(strOldPath),strNewPath)
,总是提示出错! "未能找到路径中的某一部分" 怎么回事呢? 请指教,谢谢!

------解决方案--------------------
destFileName
目标文件名称。不能是目录。
myWebClient.DownloadFileAsync(NewUri(strOldPath),strNewPath)
'下面代码放到myWebClient下载进度事件里,并判断下载结束后调用
myWebClient.Dispose()

myWebClient=Nothing
TxtBoxLog.Text="完成下载:"+strOldPath&vbCrLf&TxtBoxLog.Text

猜你在找的XML相关文章