这是我的代码。
var storage = IsolatedStorageFile.GetUserStoreForApplication();
if (!directoryPath.StartsWith("/"))
directoryPath = "/" + directoryPath;
if (!storage.DirectoryExists(directoryPath))
{
storage.CreateDirectory(directoryPath);
}
有时当我调用此方法时会出现以下异常。
[Type]:[IsolatedStorageException]
[ExceptionMessage]:[Unable to create directory.]
我不知道为什么我会收到这个异常。我的代码有问题吗?它工作正常很多次,但有时我遇到异常。
请让我知道我的代码中有什么问题。