在我的應用程序中,我試圖一次下載大約180個小音頻文件。我嘗試了BackgroundTransferService,但對於如此多的小文件來說似乎並不穩定。所以,現在我正在下載所有這些音頻的ZIP文件,並希望將它們提取到「音頻」文件夾中。我想在這個線程的方法:如何在Windows Phone 8應用程序中的IsolatedStorage中解壓縮文件?
How to unzip files in Windows Phone 8
但我得到這個錯誤:在下面的代碼'System.IO.IOException' occurred in mscorlib.ni.dll...
。我怎樣才能克服這個問題?
while (reader.ReadInt32() != 101010256)
{
reader.BaseStream.Seek(-5, SeekOrigin.Current); // this line causes error
}...
另外,我需要在哪裏放置這段代碼,以及我在哪裏給它的目標目錄?
IsolatedStorageFile myIsolatedStorage = IsolatedStorageFile.GetUserStoreForApplication();
using (IsolatedStorageFileStream fileStream = myIsolatedStorage.OpenFile(@"audio.rar", FileMode.Open, FileAccess.ReadWrite))
{
UnZipper unzip = new UnZipper(fileStream);
foreach (string filename in unzip.FileNamesInZip())
{
string FileName = filename;
}
}
始終包含你正在使用或您的問題將不會被大多數主題專家可以看到語言的標籤。 –
對不起。這裏提出問題的新手。將來要記住:-)謝謝。 – hnabbasi
爲什麼尋找落後直到你找到「魔法值」?您可能會遇到負面的查找位置,這是導致錯誤的原因。 –