我目前有一个 XElement。我用它来打印它:
System.Diagnostics.Debug.WriteLine(hostedServices);
结果:
<HostedServices xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<HostedService>
<Url>url</Url>
<ServiceName>testcloudservice2</ServiceName>
<HostedServiceProperties>
<Description>New cloud service</Description>
<Location>West Europe</Location>
<Label>dGVzdGNsb3Vkc2VydmljZTI=</Label>
<Status>Created</Status>
<DateCreated>2013-04-02T09:40:27Z</DateCreated>
<DateLastModified>2013-04-02T09:40:26Z</DateLastModified>
<ExtendedProperties />
</HostedServiceProperties>
</HostedService>
<HostedService>
<Url>url</Url>
<ServiceName>testtesttest123445</ServiceName>
<HostedServiceProperties>
<Description>New cloud service</Description>
<Location>West Europe</Location>
<Label>dGVzdHRlc3R0ZXN0MTIzNDQ1</Label>
<Status>Created</Status>
<DateCreated>2013-04-02T09:30:34Z</DateCreated>
<DateLastModified>2013-04-02T09:30:34Z</DateLastModified>
<ExtendedProperties />
</HostedServiceProperties>
</HostedService>
</HostedServices>
我想获取每个<HostedService>
. 我怎样才能得到这些?