列出S3文件时出现异常。
**"Operation is not valid due to the current state of the object."**
以下是我的代码:
do
{
Console.Write(HashS3Objects.Count+"\t\t\r" );
try
{
listResponse = client.ListObjects(listRequest);
foreach (S3Object obj in listResponse.S3Objects)
{
try
{
HashS3Objects.Add(obj.Key, obj);
}
catch (Exception ex1)
{
Console.WriteLine(ex1.Message);
}
}
}
catch(Exception ex1) **// This catch block catches the exception**
{
Console.WriteLine(ex1.Message);
}
listRequest.Marker = listResponse.NextMarker;
} while (listResponse.IsTruncated);
行listResponse = client.ListObjects(listRequest);抛出异常。