我有一个似乎无法使用隔离存储的 Windows 服务(很可能是因为我做错了什么)。该服务在本地系统下运行。每次我运行代码时,隔离存储文件夹都没有变化。有人可以告诉我为什么会这样。我在 Windows 7 和 Windows 8.1 上试过
IsolatedStorageFileStream configFile = new IsolatedStorageFileStream("UIsolate.cfg", FileMode.Create);
// create a writer to write to the stream
StreamWriter writer = new StreamWriter(configFile);
// write some data to the config. file
writer.WriteLine("test");
// flush the buffer and clean up
sr.Close();
writer.Close();
configFile.Close();