Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/261.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# UWP-图片库-访问被拒绝_C#_Windows Phone_Win Universal App - Fatal编程技术网

C# UWP-图片库-访问被拒绝

C# UWP-图片库-访问被拒绝,c#,windows-phone,win-universal-app,C#,Windows Phone,Win Universal App,我有以下代码: FileSavePicker savePicker = new FileSavePicker(); savePicker.FileTypeChoices.Add("Plain Text", new List<string>() { ".txt" }); savePicker.SuggestedStartLocation = PickerLocationId.PicturesLibrary; savePicker.SuggestedFileName = "New Doc

我有以下代码:

FileSavePicker savePicker = new FileSavePicker();
savePicker.FileTypeChoices.Add("Plain Text", new List<string>() { ".txt" });
savePicker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;
savePicker.SuggestedFileName = "New Document";
savePicker.SuggestedSaveFile = photo;
await savePicker.PickSaveFileAsync();
FileSavePicker savePicker=newfilesavepicker();
savePicker.FileTypeChoices.Add(“纯文本”,新列表(){.txt});
savePicker.SuggestedStartLocation=PickerLocationId.PicturesLibrary;
savePicker.SuggestedFileName=“新建文档”;
savePicker.SuggestedSaveFile=photo;
等待savePicker.PickSaveFileAsync();
我的appxmanifest看起来像:


资产\StoreLogo.png
但在调试时,我总是会遇到“访问被拒绝”错误。
我在拍照后使用了这个C代码,因为我需要将其转换为Base64,我得到了一些教程,其中我必须先保存图像,然后使用流等。或者你有更好的解决方案将图像转换为Base64。我需要Base64使用HttpClient通过POST方法将图片发送到web API。

您可以将文件保存在本地文件夹中。您不需要清单中的任何功能

StorageFile sf =  await ApplicationData.Current.LocalFolder.CreateFileAsync("filename.txt");

顺便说一下,如果您想发送小文件,可以使用HttpClient。不建议将其用于大数据

Hi@Pawel,欢迎使用StackOverflow!为了帮助S.O.用户,问题的清晰性很重要。除了
拒绝访问
错误之外,我相信您还要求其他一些东西。请编辑您的问题并将其分解。如果您可以指定到目前为止您已经尝试过的解决方案,这也会有所帮助。干杯