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中使用設置?