0

我正在考虑将 IsolatedStorage 用于我的临时文件。但是,文档似乎暗示存储空间由 Windows 用户帐户决定,对于 ASP.NET 应用程序来说,该帐户是 NETWORK SERVICES。如果有多个网站/应用程序使用 NETWORK SERVICES 作为他们的帐户,这是否意味着它们都将共享相同的 IsolatedStorage 并能够读取彼此的文件?

4

1 回答 1

1

我认为如果您IsolatedStorageFileStream使用实例构建您的IsolatedStorageFile实例,您将拥有更大的灵活性,因为它们可以在例如特定于应用程序的基础上创建:

using (IsolatedStorageFile isf = IsolatedStorageFile.GetMachineStoreForApplication())
using (IsolatedStorageFileStream isfs = new IsolatedStorageFileStream("filename", FileMode.Create, isf))
{
    // Code using the file stream here...
}
于 2009-05-27T14:28:40.313 回答