Tag: isolatedstorage

IsolatedStorage:删除卸载程序中的首选项?

我们的应用程序将用户偏好保存在隔离存 但是,从我们的卸载程序中删除这些文件certificate是棘手的! 我可以枚举IsolatedStorage中的所有文件(使用MSDN示例代码),找到与我们的强名称密钥相关的文件,并尝试删除/删除它们。 不幸的是,这就是崩溃的地方: 未为此商店定义MaxSize。 执行了需要访问MaxSize的操作。 使用枚举API获得的商店没有明确定义的MaxSize,因为使用了部分证据来打开商店。 有人能帮忙吗? 我想我可以花几天时间试图伪造一些证据以允许安装程序充当冒名顶替者,但必须有一个更好(更快,更清洁)的方式?! 如果没有,我想我正在回到旧的注册表。

Windows Phone 7.1应用程序中的自动登录过程

在我的Windows Phone应用程序( silverlight应用程序 )中,我希望用户在成功登录后自动登录到应用程序。 即我不希望用户每次都登录。 我通过Isolated Storage文件概念实现了这一点。 即我首先创建了一个目录,然后创建了一个独立的存储文件流 ,并将电子邮件和密码凭据存储在某个文件中。 当我停止调试并重新启动时,我的流阅读器会成功读取该文件中的电子邮件密码凭据。 我的问题是当我关闭我的模拟器并将其打开时,我无法从该文件中读取。(特别是,目录本身不存在!)。我还想知道我的独立存储在真正的Windows手机中存在吗? 我怎么能解决这个问题?

Windows Phone 7中的网格

我有一个网格视图代码,下面分为3列 。 但我的代码有问题。 检索多个数据时 。 3列中的所有数据都是重叠的。 如何修改下面的代码,例如它会在它下面一个接一个地显示。 //Define grid column, size Grid schedule = new Grid(); foreach (var time in timeSplit) { timeList = time; //Column 1 to hold the time of the schedule ColumnDefinition scheduleTimeColumn = new ColumnDefinition(); GridLength timeGrid = new GridLength(110); scheduleTimeColumn.Width = timeGrid; schedule.ColumnDefinitions.Add(scheduleTimeColumn); //Text block that show the time of […]

访问IsolatedStorageBackingStore时出现HRESULT 0X80131468的原因

我面临的情况是我在W2k3服务器上运行的ASP.NET Web服务(.NET 3.5),该服务器使用CacheManager / IsolatedStorage存储来存储持久化状态变量。 在我们更改物理机器之前,此配置已经运行了很长时间。 现在,当访问该值的代码运行时,它会抛出IsolatedStorageException(在下面发布)。 据我所知,用户/程序集存储是正在访问的内容,执行用户是本地管理员组的成员。 有没有人建议缺少什么特权? 错误 无法创建商店目录。 (HRESULTexception:0x80131468) 堆栈跟踪 键入:Microsoft.Practices.ObjectBuilder2.BuildFailedException。 错误:当前构建操作(构建密钥构建密钥[Microsoft.Practices.EnterpriseLibrary.Caching.ICacheManager,缓存管理器])失败:无法创建商店目录。 (来自HRESULT的exception:0x80131468)(策略类型为ConfiguredObjectStrategy,索引2)。 跟踪:位于Microsoft.Practices的Microsoft.Practices.ObjectBuilder2.Builder.BuildUp(IReadWriteLocator定位器,ILifetimeContainer生命周期,IPolicyList策略,IStrategyChain策略,Object buildKey,Object existing)上的Microsoft.Practices.ObjectBuilder2.StrategyChain.ExecuteBuildUp(IBuilderContext context)。 ObjectBuilder2.Builder.BuildUp [TTypeToBuild](IReadWriteLocator定位器,ILifetimeContainer生命周期,IPolicyList策略,IStrategyChain策略,Object buildKey,Object existing),位于Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.EnterpriseLibraryFactory.BuildUp [T](IReadWriteLocator定位器, ILifetimeContainer lifetimeContainer,IConfigurationSource configurationSource)at Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ObjectBuilder.LocatorNameTypeFactoryBase 1.CreateDefault() at Microsoft.Practices.EnterpriseLibrary.Caching.CacheFactory.GetCacheManager() at Ept.Commands.SettlementCommand.BeginSettlement() in c:\Projects\EPT\Ept.Framework.Services\Commands\SettlementCommand.cs:line 102 at Ept.Commands.SettlementCommand.ExecuteKernel(SettlementRequest request) in c:\Projects\EPT\Ept.Framework.Services\Commands\SettlementCommand.cs:line 188 at Ept.Command 1.CreateDefault() at Microsoft.Practices.EnterpriseLibrary.Caching.CacheFactory.GetCacheManager() at Ept.Commands.SettlementCommand.BeginSettlement() in c:\Projects\EPT\Ept.Framework.Services\Commands\SettlementCommand.cs:line 102 at Ept.Commands.SettlementCommand.ExecuteKernel(SettlementRequest […]

IsolatedStorageException:无法创建商店目录

嗨,我必须在隔离空间中存储一些隐藏的信息。 为此,我正在使用System.IO.Isolated类 IsolatedStorageFile isf = System.IO.IsolatedStorage.IsolatedStorageFile.GetStore(IsolatedStorageScope.User | IsolatedStorageScope.Assembly, null, null); Stream writer = new IsolatedStorageFileStream(filename, FileMode.Create, isf); IFormatter formatter = new BinaryFormatter(); formatter.Serialize(writer, appCollection.ToString()); writer.Close(); 它在Windows XP中运行良好,但在生产服务器上是Windows 2003,它显示exception System.IO.IsolatedStorage.IsolatedStorageException:无法创建商店目录。 我的asp.net项目文件夹中有Everyone完全控制权限。 注意CSoft.Core是由我创建的个人框架。 这是我的Stack Trace: [IsolatedStorageException:无法创建商店目录。 (HRESULTexception:0x80131468)] System.IO.IsolatedStorage.IsolatedStorageFile.nGetRootDir(IsolatedStorageScope范围)+0 System.IO.IsolatedStorage.IsolatedStorageFile.InitGlobalsNonRoamingUser(IsolatedStorageScope范围)+97 System.IO.IsolatedStorage.IsolatedStorageFile.GetRootDir(IsolatedStorageScope范围)+137 System.IO.IsolatedStorage.IsolatedStorageFile.GetGlobalFileIOPerm(IsolatedStorageScope范围)+213 System.IO.IsolatedStorage.IsolatedStorageFile.Init(IsolatedStorageScope范围)+56 System.IO.IsolatedStorage.IsolatedStorageFile.GetStore(IsolatedStorageScope范围,类型domainEvidenceType,类型assemblyEvidenceType)+59 Coft.Core.IO.StorageHelper.Save(String fileName,String content)在c:\ Projectos \ FrameworkCS \ CSoft.Core \ IO \ StorageHelper.cs:18 Coft.Web.UI.ViewStateHelper.SerializeViewState(HttpContext context,Object […]

当BackgroundAudioPlayer的实例处于活动状态时,如何在IsolatedStorage中保存设置?

我的解决方案中有两个项目。 让我们说项目A和项目B. 项目A. 这是主要项目,并有设置。 我有一个复选框,为用户提供“重复”曲目的选项。 该项目还可以访问PROJECT B的公共实例。 项目B. 它是BackgroundAudioAgent并且拥有自己的设置。 此项目无权访问PROJECT A设置。 因此,在PROJECT A中,我需要访问PROJECT B的设置并将其保存在那里。 因此,当启用“重复”时,代理会重新开始播放。 问题 当BackgroundAudioPlayer的实例运行时,我无法保存设置(换句话说,设置已保存,但不会产生任何影响)。 我总是要关闭实例,当我这样做时,可以更改设置。 题 做我想做的事最有效的方法是什么? 如何在不关闭BackgroundAudioPlayer实例的情况下保存IsolatedStorage中的设置? (因为我不想打断正在播放的任何曲目)。 代码:我需要做些什么来保存设置。 public bool SettingAudioRepeat { get { return GetValueOrDefault(SettingAudioRepeatKeyName, SettingAudioRepeatDefault); } set { if (AddOrUpdateValue(SettingAudioRepeatKeyName, value)) { bool resumePlay = false; try { if (BackgroundAudioPlayer.Instance.PlayerState != PlayState.Shutdown) { BackgroundAudioPlayer.Instance.Close(); resumePlay = true; } […]

加载页面后立即Windows手机导航

我有2页。(MainPage.xaml,second.xaml)MainPage.xaml是登录页面。 在此页面中,我发送登录名和密码,并收到结果。 我将它们(结果)保存在Isolate Storage中并导航到second.xaml页面; 当我下次启动这个应用程序时,我从Isolate Storage中提取数据,我想立即导航second.xaml,但我不知道如何 我试着写 public MainPage() { InitializeComponent(); //function for Isolate storage InitializeSettings(); NavigationService.Navigate(new Uri(“/Conversation.xaml”, UriKind.Relative)); } 但它不起作用)我明白我无法使用与MainPage()构造函数关联的导航代码。 当然,我可能会做简单的按钮,但我希​​望快速导航 我想可能是它与App.xaml方法有关 private void Application_Launching(object sender, LaunchingEventArgs e) 例如,写我的方法 //function for Isolate storage InitializeSettings(); 有导航吗?(导航在这个例子中不起作用) private void Application_Launching(object sender, LaunchingEventArgs e) { InitializeSettings(); NavigationService.Navigate(new Uri(“/Conversation.xaml”, UriKind.Relative)); } 我可以在哪里使用导航,所以直接进入second.xaml页面,没有完全加载MainPage.xaml(可能没有MainPage.xaml)

如何从隔离存储中获取图像

我有这个XAML 在守则中: using (IsolatedStorageFile isoStore = IsolatedStorageFile.GetUserStoreForApplication()) { IsolatedStorageFileStream isoStoreStream = isoStore.OpenFile(“chart.xml”, FileMode.Open); using (StreamReader reader = new StreamReader(isoStoreStream)) { XElement xml = XElement.Parse(reader.ReadToEnd()); var list = from var in xml.Descendants(“Pos”) select new Single { Pos = Int32.Parse(var.Attribute(“id”).Value), Img = how read from isolated storage the image id.jpg? }; public class Single { public int […]

从Windows Phone 7中读取文件

我的项目中有一个名为data/的文件夹,其中包含txt files 。 我将Build Action配置为所有文件的resources 。 我试过这些不同的方式: 方法1 var resource = Application.GetResourceStream(new Uri(fName, UriKind.Relative)); StreamReader streamReader = new StreamReader(resource.Stream); Debug.WriteLine(streamReader.ReadToEnd()); 方法2 IsolatedStorageFile myIsolatedStorage = IsolatedStorageFile.GetUserStoreForApplication(); string[] fileNames = myIsolatedStorage.GetFileNames(“*.txt”); 方法3 using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication()) { using (StreamReader fileReader = new StreamReader(new IsolatedStorageFileStream(fName, FileMode.Open, isf))) { while (!fileReader.EndOfStream) { string line = fileReader.ReadLine(); al.Add(line); Debug.WriteLine(line); […]

在IsolatedStorage中重命名文件

我需要重命名IsolatedStorage中的文件。 我怎样才能做到这一点?