我的应用程序中有两个程序集。 MyApplication.BO
和MyApplication.GUI
。应用程序设置保存
我已经为我的BO程序集配置了属性设置。
现在,当我试图编译下面的代码:
public class MyApplicationInfo
{
private string _nameOfTheUser;
public string FullNameOfTheUser
{
get { return _nameOfTheUser; }
set { _nameOfTheUser = value; }
}
public void Save()
{
try
{
MyApplication.BO.Properties.Settings.Default.FullNameOfTheUser = this.FullNameOfTheUser;
MyApplication.BO.Properties.Settings.Default.Save();
}
catch (Exception ex)
{
throw ex;
}
}
}
VS2005是给我下面的编译错误:
Error 1 Property or indexer 'MyApplication.BO.Properties.Settings.FullNameOfTheUser' cannot be assigned to -- it is read only F:\CS\MyApplication\MyApplication.BO\MyApplicationInfo.cs 57 17 MyApplication.BO
什么是错我的做法?