逗人, 我使用C#
编写了一个代码来列出实例平台和显示AmazonEC2Client amazonEC2Client = new AmazonEC2Client("id", "password", Amazon.RegionEndpoint.USEast1))
DescribeInstancesRequest describeInstancesRequest = new DescribeInstancesRequest();
DescribeInstancesResponse describeInstancesResponse = amazonEC2Client.DescribeInstances(describeInstancesRequest);
List<Reservation> result = describeInstancesResponse.Reservations;
然后我可以使用以下代码获取EC2属性的值:
foreach (var reservation in result)
{
foreach (var instance in reservation.Instances)
{
instance.InstanceId;
}
}
我需要获得Name Proparty 请告诉我 在此先感谢