我有全景項目附帶的標準圖像「background.png」,並且正在嘗試訪問它。我嘗試了這段代碼,但未檢測到圖像:如何通過代碼訪問「Background.png」圖像?
using (var store = IsolatedStorageFile.GetUserStoreForApplication())
{
if (store.FileExists("Background.png"))
{
Debug.WriteLine("found");
}
else Debug.WriteLine("not found");
}
圖像位於何處?
真正的問題是我通過「add> existing item>」向項目添加一個文件,並希望得到它的真實路徑。
什麼是用於寫入圖像的代碼?您確定它位於用戶的應用程序商店中,還是位於另一家獨立存儲中的商店? – casperOne
也許你的意思是這個錯誤? http://blog.wpfwonderland.com/2010/10/04/incorrect-path-to-winphone-backgroundpng-in-visual-studio/ –
@casperOne該圖像是Visual Studio項目根目錄中的默認圖像,是不是默認的用戶存儲? – Alex