简体   繁体   English

类型或名称空间“ IsolatedStorage”在名称空间“ System.IO”中不存在(您是否缺少程序集或引用?)

[英]The type or namespace 'IsolatedStorage' does not exist in the namespace 'System.IO' (are you missing an assembly or reference?)

I have hit a problem with isolated storage, basically I am making an app for both windows phone and windows desktop for my isolated storage in windows phone I'm using the following; 我遇到了隔离存储的问题,基本上,我正在为Windows Phone和Windows桌面制作一个应用程序,用于Windows Phone中的隔离存储。

System.IO.IsolatedStorage.IsolatedStorageFile userStore = System.IO.IsolatedStorage.IsolatedStorageFile.GetUserStoreForApplication();

using (var isoFileStream = new System.IO.IsolatedStorage.IsolatedStorageFileStream("students.txt", System.IO.FileMode.Open, userStore))
{
    using (var isoFileReader = new System.IO.StreamReader(isoFileStream))
    {

    }
}

and I assumed it would be the same for windows desktop but apparently it's not, is there a different way to achieve the same thing? 我以为Windows桌面将是相同的,但显然不是,实现相同目标的方法是否不同? To avoid the error! 为了避免错误!

You might be doing a .NET app for Windows Store (Windows 8 and above) and not a normal Win Forms App. 您可能正在为Windows Store (Windows 8及更高版本)使用.NET应用程序,而不是普通的Win Forms应用程序。 You need to use the Windows.Storage namespace. 您需要使用Windows.Storage命名空间。

There is no direct System.IO.IsolatedStorage namespace.. 没有直接的System.IO.IsolatedStorage命名空间。

use Windows.Storage.ApplicationData.Current.LocalData instead of System.IO.IsolatedStorage.IsolatedStorageFile class. 使用Windows.Storage.ApplicationData.Current.LocalData代替System.IO.IsolatedStorage.IsolatedStorageFile类。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 命名空间“System.IO”中不存在类型或命名空间名称“Ports”(您是否缺少程序集引用?) - The type or namespace name 'Ports' does not exist in the namespace 'System.IO' (are you missing an assembly reference?) 类型或名称空间名称“文件”在名称空间“ System.IO”中不存在 - The type or namespace name 'File' does not exist in the namespace 'System.IO' 命名空间“System.IO”中不存在类型或命名空间名称“Ports” - The type or namespace name 'Ports' does not exist in the namespace 'System.IO' 类型或名称空间名称在名称空间中不存在“是否缺少程序集引用?” - The type or namespace name does not exist in the namespace ''are you missing an assembly reference ?" 命名空间中不存在类型或命名空间名称(您是否缺少程序集引用?) - The type or namespace name does not exist in the namespace (are you missing an assembly reference?) 命名空间“System.Web”中不存在类型或命名空间名称“Mvc”(您是否缺少程序集引用?)Kentico - The type or namespace name 'Mvc' does not exist in the namespace 'System.Web' (are you missing an assembly reference?) Kentico 类型或名称空间名称“ OleDb”在名称空间“ System.Data”中不存在(您是否缺少程序集引用?) - The type or namespace name 'OleDb' does not exist in the namespace 'System.Data' (are you missing an assembly reference?) 命名空间“System.Web”中不存在类型或命名空间名称“Mvc”(您是否缺少程序集引用?) - The type or namespace name 'Mvc' does not exist in the namespace 'System.Web' (are you missing an assembly reference?) 类型或名称空间名称“ SerializableAttributeAttribute”在名称空间“系统”中不存在(您是否缺少程序集引用?) - The type or namespace name 'SerializableAttributeAttribute' does not exist in the namespace 'System' (are you missing an assembly reference?) 命名空间“System.Web.UI”中不存在类型或命名空间名称“DataVisualization”(您是否缺少程序集引用?) - The type or namespace name 'DataVisualization' does not exist in the namespace 'System.Web.UI' (are you missing an assembly reference?)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM