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