简体   繁体   English

如何保存到用户设置?

[英]How to save to user settings?

I added some properties to the resources:我在资源中添加了一些属性:

资源

but i can't get access to the first one the Interval:但我无法访问第一个间隔:

[DefaultValue(200)]
public int TimerInterval
{
    get => m_Interval;
    set
    {
        value = Math.Max(55, Math.Min(value, 500));
        if (m_Interval != value)
        {
            m_Interval = value;
            dotsTimer.Interval = m_Interval;

            Properties.Settings.Default.in
        }
    }
}

there is no Interval after the dot when i typed Default.当我输入默认值时,点后没有间隔。 there is no Interval.没有间隔。

and how do i set in the resources the interval to be type int and not string?以及如何在资源中将间隔设置为 int 而不是 string?

You can use User or Application settings instead of resources, that way you can choose the type.您可以使用用户或应用程序设置而不是资源,这样您就可以选择类型。 You can find it under project > project properties您可以在project > project properties下找到它

在此处输入图像描述

Click Create or open application settings单击创建或打开应用程序设置

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM