0
这是我的代码。尝试在windows phone应用程序中创建目录时出现IsolatedStorageException
var storage = IsolatedStorageFile.GetUserStoreForApplication();
if (!directoryPath.StartsWith("/"))
directoryPath = "/" + directoryPath;
if (!storage.DirectoryExists(directoryPath))
{
storage.CreateDirectory(directoryPath);
}
有时我会在我调用此方法时出现以下异常。
[Type]:[IsolatedStorageException]
[ExceptionMessage]:[Unable to create directory.]
我不知道为什么我得到这个例外。我的代码有问题吗?它工作正常很多次,但有些时候我正在得到例外。
请让我知道我的代码中有什么问题。
为什么要添加斜杠(“/”)? – kennyzx 2014-10-06 14:47:38
它只是用于指定目录路径。即使我删除了斜杠,我也面临同样的问题。 – Mounika 2014-10-07 05:08:43