Universal.torrent (monotorrent) Доступ к пути "..." запрещен
При попытке загрузить файл из.torrent с помощью Universal.torrent (monotorrent для UWP) я получаю сообщение об ошибке "Доступ к пути" запрещен " https://github.com/zumicts/Universal.Torrent,
Вот мой код:
private async void Torrenttest_Click(object sender, RoutedEventArgs e)
{
TorrentFunc tf = new TorrentFunc(ApplicationData.Current.LocalFolder);
FileOpenPicker openPicker = new FileOpenPicker();
openPicker.FileTypeFilter.Add(".torrent");
openPicker.ViewMode = PickerViewMode.List;
openPicker.SuggestedStartLocation = PickerLocationId.Desktop;
StorageFile file = await openPicker.PickSingleFileAsync();
tf.DownloadTorrent(file.Path);
}
а также
class TorrentFunc
{
ClientEngine engine;
StorageFolder savePath;
// savePath is the directory where downloads will be stored
public TorrentFunc(StorageFolder Path)
{
// Create a basic ClientEngine without changing any settings
this.engine = new ClientEngine(new EngineSettings());
this.savePath = Path;
}
public async void DownloadTorrent(string path)
{
Torrent torrent = await Task.Run(() => Torrent.Load(path));
// StorageFolder storageFolder = await StorageFolder.GetFolderFromPathAsync(savePath);
TorrentManager manager = new TorrentManager(torrent, savePath, new TorrentSettings());
engine.Register(manager);
manager.Start();
}
}
Ошибка появляется в строке "Torrent torrent = await Task.Run(() => Torrent.Load(path));"
Файл, который я пытаюсь получить, находится на моем рабочем столе, и это простой.torrent-файл.
Спасибо, что прочитали это и если у вас есть идеи;)