2017-02-08 38 views

回答

2

我覺得這可能是工作:

Windows.Storage.ApplicationDataContainer localSettings = Windows.Storage.ApplicationData.Current.LocalSettings; 

    public MainPage() 
    { 
     this.InitializeComponent(); 

     //Count App starts 
     object Counter = localSettings.Values["AppStartCounter"]; 

     if (Counter != null) 
     { 
      localSettings.Values["AppStartCounter"] = (int)Counter + 1; 
     } 
     else 
     { 
      localSettings.Values["AppStartCounter"] = 1; 
     } 
    } 
+2

我想建議相同。但我建議你把它移到'App.xaml.cs'而不是'MainPage.xaml.cs'。 – AVK

0

沒有這樣的SDK,你必須自己實現它。

相關問題