gpt4 book ai didi

c# - 我是否需要在 Windows Phone 应用程序中调用 IsolatedStorageSettings.Save 方法?

转载 作者:太空狗 更新时间:2023-10-30 00:26:07 26 4
gpt4 key购买 nike

来自IsolatedStorageSettings.Save Method的备注部分页:

Data written to the IsolatedStorageSettings object is saved when the application that uses the class is closed. This can occur when the user closes the Web browser, refreshes a page, or browses away from the page. If you want your application to write to isolated storage immediately, you can call the Save method in application code.

因此,我永远无法调用Save 方法,并且每个设置都是安全的。我只是好奇我应该在哪些用例中使用 Save 方法?

最佳答案

您必须自己调用 IsolatedStorageSettings.Save。正如 class reference page 底部的“提示和警告”部分所述,您必须自己保存它以确保它已写入文件。

The IsolatedStorageSettings class is not automatically saved to disk when values are written. Saves are done in a finalizer, which is usually but not always run when the application shuts down. To ensure saves are actually performed we need to call the Save method after each write or set of writes.

关于c# - 我是否需要在 Windows Phone 应用程序中调用 IsolatedStorageSettings.Save 方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13234131/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com