2010-09-10 29 views
0

爲了救我CONFIGURATION_DATA我使用隔離stoeage域範圍,如:WPF。 IsolatedStoreage文件名長度

IsolatedStorageFile isoFile = 
    IsolatedStorageFile.GetUserStoreForDomain(); 

但有時在保存數據,我得到:

System.Reflection.TargetInvocationException: Exception has been thrown by the 
    target of an invocation. ---> System.IO.PathTooLongException: The specified path, 
    file name, or both are too long. The fully qualified file name must be less than 
    260 characters, and the directory name must be less than 248 characters. 
    at System.IO.PathHelper.Append(Char value) 
    at System.IO.Path.NormalizePath(String path, Boolean fullCheck, Int32 maxPathLength) 

好我的文件名太長。但我無法控制它。另外我不能使用應用程序範圍,因爲我不使用ClickOnce。

那我該怎麼辦? 謝謝

回答

1

這是IsolatedStorage的已知問題。

您可以使用用戶配置文件(AppData)將信息存儲到IsolatedStorage API中。

+0

謝謝。你可以如此友善地給一些鏈接? – 2010-09-14 09:43:10

+0

對於這個問題,我們圍繞SpecialFolder枚舉構建了一個包裝(請參閱http://msdn.microsoft.com/en-us/library/system.environment.specialfolder.aspx)。創建我們的存儲目錄,然後根據需要構建目錄結構(「緩存」,「更新」等)。 – 2010-09-14 10:34:49