我可以使用下面的代码检索包含有关文件信息的XML:
XElement responseXML = XElement.Load(AWS_S3_URL);
ICollection<XElement> fileElements = responseXML.Elements("Contents") as ICollection<XElement>;
Debug.Log("responseXML.Elements() ===== " + fileElements.ToString());
第一行代码返回以下xml。但我无法检索元素的数量:
<ListBucketResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<Name>XXXXXXXXXXXX</Name>
<Prefix />
<Marker />
<MaxKeys>1000</MaxKeys>
<IsTruncated>false</IsTruncated>
<Contents>
<Key>AffectivaLogs/</Key>
<LastModified>2018-04-16T00:20:06.000Z</LastModified>
<ETag>"d41d8cd98f00b204e9800998ecf8427e"</ETag>
<Size>0</Size>
<Owner>
<ID>65a011a29cdf8ec533ec3d1ccaae921c</ID>
</Owner>
<StorageClass>STANDARD</StorageClass>
</Contents>
<Contents>
<Key>Bean Man with Affectiva.Editor.csproj</Key>
<LastModified>2018-04-16T05:40:43.000Z</LastModified>
<ETag>"7ea67a5fa37ceaeaa90ef3dbebddb201"</ETag>
<Size>34349</Size>
<StorageClass>STANDARD</StorageClass>
</Contents>
</ListBucketResult>
答案 0 :(得分:0)
可以使用XElement
代替XmlDocument responseXML = new XmlDocument();
responseXML.Load(AWS_S3_URL);
XmlElement root = responseXML.DocumentElement;
XmlNodeList node = root.GetElementsByTagName("Contents");
Debug.Log("responseXML.Elements() ===== " + node.Count);
轻松完成。
InfInt myint1 = "15432154865413186646848435184100510168404641560358";
InfInt myint2 = 156341300544608LL;
myint1 *= --myint2 - 3;
std::cout << myint1 << std::endl;