XMl如下:
  <?xml version="1.0" standalone="yes" ?> 
- <config>
- <File>
  <Task TaskId="1" Name="数据库" Source="E:\" /> 
  <Task TaskId="2" Name="测试任务" Source="D:\我的文档\桌面\7TP4"/> 
  </File>
</config>我现在想选出Taskid为1的Source的值
写xml是否为MyXmlDocument.SelectSingleNode("config/FileCopy/@Source[@TaskId='1']").Value
还是
MyXmlDocument.SelectSingleNode("config/FileCopy/Task[@TaskId='1']").SelectSingleNode("@Source").Value;但是使用后者的话,下面代码在使用MyXmlDocument,总提示我“未将对象引用设置到对象的实例”请高手赐教!