开发者

SecurityException was unhandled when using isolated storage

开发者 https://www.devze.com 2023-01-25 09:19 出处:网络
When using this code I get the above error: var userSettings = new UserSettings() { Username = TextBox_Username.ToString(),

When using this code I get the above error:

        var userSettings = new UserSettings()
        {
            Username = TextBox_Username.ToString(),
            Password = TextBox_Password.ToString(),
            Operator = OperatorList.O2
        };

        var settings = IsolatedStorageSettings.ApplicationSettings;
        settings.Add("UserSettings", userSettings);
        settings.Save();

I开发者_StackOverflow社区'm not sure why? though.


Fixed it. Any stored class needs to be marked as public marking classes internal is not allowed. The issue happened because C# does not default to public scope with new classes.

0

精彩评论

暂无评论...
验证码 换一张
取 消