private String MyConStr
{
get
{
myConStr = "Provider=SQLOLEDB;" +
"Data Source=" + GlobalConfig.runningConfig.DatabaseIp + ",1433;" +
"Initial Catalog=spc-belden;" +
"User ID=" + GlobalConfig.runningConfig.DatabaseUsername + ";" +
"Password=" + GlobalConfig.runningConfig.DatabasePassword + ";";
return myConStr;
}
}
private string myConStr;
这就是定义一个变量的Getter/ Setter
一般我们如果没有特殊说明。就直接写
public string MyParams { get; set; }
苏噶,明白了,谢谢