c#windows phone下载文件夹

时间:2014-12-09 10:45:03

标签: c# windows-phone-8 windows-phone-8.1

根据http://msdn.microsoft.com/en-us/library/windows/apps/hh202959(v=vs.105).aspx 我创建了一个backgroundtransfer。我想在下载完成后,该文件移动到“根目录下载文件夹”(手机或SD卡/下载)。我不知道怎么做,微软改变了Windows Phone上的所有代码。

microsoft编写了关于该主题的代码>

case TransferStatus.Completed:

  // If the status code of a completed transfer is 200 or 206, the
  // transfer was successful
  if (transfer.StatusCode == 200 || transfer.StatusCode == 206)
  {
    // Remove the transfer request in order to make room in the
    // queue for more transfers. Transfers are not automatically
    // removed by the system.
    RemoveTransferRequest(transfer.RequestId);

    // In this example, the downloaded file is moved into the root
    // Isolated Storage directory
    using (IsolatedStorageFile isoStore = IsolatedStorageFile.GetUserStoreForApplication())
    {
      string filename = transfer.Tag;
      if (isoStore.FileExists(filename))
      {
        isoStore.DeleteFile(filename);
      }
      isoStore.MoveFile(transfer.DownloadLocation.OriginalString, filename);
    }
  }
break;

但我不知道移动时该文件在哪里!

请给我一个代码。

0 个答案:

没有答案