簡體   English   中英

嘗試在Windows Phone應用程序中創建目錄時獲取IsolatedStorageException

[英]Getting IsolatedStorageException when trying to create directory in windows phone application

這是我的代碼。

var storage = IsolatedStorageFile.GetUserStoreForApplication();
if (!directoryPath.StartsWith("/"))
            directoryPath = "/" + directoryPath;

if (!storage.DirectoryExists(directoryPath))
{
    storage.CreateDirectory(directoryPath);
}

有時,當我調用此方法時會遇到異常。

[Type]:[IsolatedStorageException]    
[ExceptionMessage]:[Unable to create directory.]

我不知道為什么會收到這個例外。 我的代碼有什么問題嗎? 它多次正常運行,但有時我遇到異常。

請讓我知道我的代碼有什么問題。

我收到此錯誤消息。 原來我應該使用文件夾名稱時才使用完整目錄路徑。

在將其更改為最后一個文件夾名稱后,它停止引發此異常。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM