存储文件夹 "access denied"
StorageFolder "access denied"
我的问题是我想在网络路径上保存图片
我试过这个:
private async void BtnSave_Click(object sender, RoutedEventArgs e)
{
StorageFolder storageFolder = await StorageFolder.GetFolderFromPathAsync(@"\myserver\signatures");
StorageFile file = await storageFolder.GetFileAsync("InkSample.jpg");
}
但是我得到一个错误:访问被拒绝。我该如何解决这个错误?
"access denied"可能是缺少某些能力造成的:
家庭和工作网络功能:PrivateNetworkClientServer
以及至少一个互联网和 public 网络功能:InternetClient、InternetClientServer
并且,如果适用,域凭据功能:EnterpriseAuthentication
注意:您必须将文件类型关联添加到您的应用清单,以声明您的应用可以在此位置访问的特定文件类型。
添加这些功能后,UWP 应用程序可在桌面上运行,但不适用于 Windows IoT 核心设备。我收到以下错误:
"Cannot access the specified file or folder. The item is not in a location that the application has access to (including application data folders, folders that are accessible via capabilities, and persisted items in the StorageApplicationPermissions lists). Verify that the file is not marked with system or hidden file attributes."
我的问题是我想在网络路径上保存图片
我试过这个:
private async void BtnSave_Click(object sender, RoutedEventArgs e)
{
StorageFolder storageFolder = await StorageFolder.GetFolderFromPathAsync(@"\myserver\signatures");
StorageFile file = await storageFolder.GetFileAsync("InkSample.jpg");
}
但是我得到一个错误:访问被拒绝。我该如何解决这个错误?
"access denied"可能是缺少某些能力造成的:
家庭和工作网络功能:PrivateNetworkClientServer
以及至少一个互联网和 public 网络功能:InternetClient、InternetClientServer
并且,如果适用,域凭据功能:EnterpriseAuthentication
注意:您必须将文件类型关联添加到您的应用清单,以声明您的应用可以在此位置访问的特定文件类型。
添加这些功能后,UWP 应用程序可在桌面上运行,但不适用于 Windows IoT 核心设备。我收到以下错误:
"Cannot access the specified file or folder. The item is not in a location that the application has access to (including application data folders, folders that are accessible via capabilities, and persisted items in the StorageApplicationPermissions lists). Verify that the file is not marked with system or hidden file attributes."