-3
{
public class Conexiune:ICloneable,IComparable<Conexiune>
{
[XmlElement("Name")]
private string Nume;
private string Server;
private string User;
private string Parola;
private string NumeBD;
public string NUME
{
get { return this.Nume; }
set { this.Nume = value; }
}
public string SERVER
{
get { return this.Server; }
set { this.Server = value; }
}
public string USER
{
get { return this.User; }
set { this.User = value; }
}
public string PAROLA
{
get { return this.Parola; }
set { this.Parola = value; }
}
public string NUMEBD
{
get { return this.NumeBD; }
set { this.NumeBD = value; }
}
public override string ToString()
{
return Nume;
}
public Conexiune()
{
}
public Conexiune(string numec, string serverc, string userc, string parolac, string numebdc)
{
this.Nume = numec;
this.Server = serverc;
this.User = userc;
this.Parola = parolac;
this.NumeBD = numebdc;
}
public object CloneP()
{
Conexiune copieP = new Conexiune(this.NUME, this.SERVER, this.USER, this.PAROLA, this.NumeBD);
return copieP;
}
public object Clone()
{
Conexiune copie = new Conexiune();
return copie;
}
//Here i want to compare
public int CompareTo(Conexiune other)
{
int result = 0;
return result;
}
}
}
我想比较2 Conexiune(连接),但我不知道由什么来比较。比较,如果你想排序后上市的目标越高,必须返回一个int
如果你不知道,我们应该怎么知道?你一定有一些想法,为什么你想比较他们和什么被认为是平等的?此外,你的“克隆”方法并不真正克隆,这是用意吗? – Silvermind
我想通过NumeBD(数据库名称)比较它们, –