void client_OpenReadCompleted(object sender, OpenReadCompletedEventArgs e)
{
if (e.Cancelled == false && e.Error == null)
{
using (IsolatedStorageFile isoFile = IsolatedStorageFile.GetUserStoreForApplication())
{
using (IsolatedStorageFileStream stream = new IsolatedStorageFileStream("files.zip", FileMode.Create, FileAccess.Write, isoFile))
{
Stream memoryStream = (Stream)e.Result;
int length = Convert.ToInt32(memoryStream.Length);
byte[] byteResult = new byte[length];
memoryStream.Read(byteResult, 0, length);
stream.Write(byteResult, 0, byteResult.Length);
memoryStream.Dispose();
memoryStream.Close();
}
}
}
}
댓글 없음:
댓글 쓰기