1
我在保存Mono(Ubuntu)上的用户设置时遇到问题。下面是代码示例:单声道无法保存用户设置
private void Form1_Load(object sender, EventArgs e)
{
string savedText = Properties.Settings.Default.tbText.ToString();
tbInput.Text = savedText;
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
string textToSave = tbInput.Text;
Properties.Settings.Default.tbText = textToSave;
Properties.Settings.Default.tbText = Properties.Settings.Default.tbText;
Properties.Settings.Default.Save();
}
但我只收到空的配置一样
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<userSettings />
</configuration>
我已经尝试过类似
Properties.Settings.Default.tbText = Properties.Settings.Default.tbText;
东西从here。但仍然得到相同的结果。我如何在Mono中使用设置?