Tôi có hai assembly trong ứng dụng của mình. MyApplication.BO
và MyApplication.GUI
.Cài đặt ứng dụng tiết kiệm
Tôi đã định cấu hình cài đặt thuộc tính cho assembly BO của mình.
Bây giờ khi tôi đang cố gắng để biên dịch đoạn mã sau:
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 là cho tôi những lỗi biên dịch sau đây:
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
Điều gì là sai với cách tiếp cận của tôi?