2013-05-12 31 views

回答

4

您可以使用IsolatedStorageSettings並檢查一個標誌。

var settings = IsolatedStorageSettings.ApplicationSettings; 
    if (!settings.Contains("WasLaunched")) { 
    MessageBox.Show("First time to launch"); 
    settings.Add("WasLaunched", true); 
    } 

注意,重新部署您的應用程序將復位標誌,因爲它只是保存在獨立存儲文件,但如果你從模擬器/實際設備中啓動您的應用程序應該工作。

+0

當用戶更新應用程序時,孤立存儲中的文件將被刪除嗎? – Chepene 2013-05-13 07:50:28

+1

不可以。如果通過Market Place進行更新,它將執行更新,而不是像Visual Studio部署那樣進行卸載/安裝。 – 2013-05-13 07:57:08