0
這是save_g
工程仿真器上,崩潰上設備(WP 8)
public static IsolatedStorageSettings save_g = IsolatedStorageSettings.ApplicationSettings;
這裏cons.term的聲明[7]是字符串類型
save_g[cons.term[7]] = (double)save_g[cons.term[7]] + 1;
聲明上面執行在模擬器上沒有問題。但是當我在設備上運行它時(Lumia 820)它會出錯。
A first chance exception of type 'System.InvalidCastException' occurred in PhoneApp2.DLL
An exception of type 'System.InvalidCastException' occurred in PhoneApp2.DLL but was not handled in user code
而且我不知道什麼是錯的。
plz幫助。
爲了簡潔的事'雙重價值= save_g [cons.term [7]] == NULL ? 0:save_g [cons.term [7]];'可以用'double value = save_g [cons.term [7]]替換? 0;'。閱讀更多關於''''運算符[here](http://stackoverflow.com/a/446839/2365197) – 2014-07-25 19:33:37