2010-09-23 148 views

回答

6

您可以使用反射來做到這一點,如圖所示linked論壇上發帖:

IsolatedStorageFileStream oStream = 
    new IsolatedStorageFileStream(ISOLATED_FILE_NAME, FileMode.Create, isoStore); 

// Get the physical path using reflection 

String filePath = oStream.GetType().GetField("m_FullPath", 
    BindingFlags.Instance | BindingFlags.NonPublic).GetValue(oStream).ToString(); 
Console.WriteLine(filePath); 
+0

不應該有可能通過低級句柄獲得使用Win32調用的路徑嗎? – Bob 2010-09-23 20:52:02

+0

@Bob - 你也許可以'PInvoke'類似的東西,但我認爲你會使用託管代碼。 – Oded 2010-09-23 20:53:30

0

在Windows 10移動的隔離存儲路徑等於Windows.Storage.ApplicationData.Current.LocalFolder

如果您知道隔離存儲器內的相對文件路徑,則可以使用System.IO.Path.Combine()來創建完整路徑。

您可以使用IsolatedStorageFile.GetUserStoreForApplication().GetFileNames()列出隔離存儲中的所有文件。

相關問題