[英]Access Denied :Unauthorised ExCeption
The following error occurred in my project, can anyone tell me how to solve this exception? 我的项目中发生以下错误,有人可以告诉我如何解决此异常吗?
Access is denied.
访问被拒绝。 (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) in windows phone 8.1.
(来自HRESULT的异常:0x80070005(E_ACCESSDENIED))在Windows Phone 8.1中。
I have this code: 我有以下代码:
using (IRandomAccessStream readStream = await file.OpenAsync(FileAccessMode.Read))
StorageFile file = usertoken ;
try
{
if (file != null)
{
using (IRandomAccessStream readStream = await file.OpenAsync(FileAccessMode.Read))
{
using (DataReader dataReader = new DataReader(readStream))
{
UInt64 size = readStream.Size;
UInt32 numBytesLoaded = await dataReader.LoadAsync((UInt32)size);
string fileContent = dataReader.ReadString(numBytesLoaded);
return (bool)true;
// NotifyUser(String.Format("The following text was read from '{0}' using a stream:{1}{2}", file.Name, Environment.NewLine, fileContent), NotifyType.StatusMessage);
}
}
}
else
{
return (bool)false;
}
}
catch
{
return (bool)false;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.