类:
public class xlxcnSocket
{
public xlxcnSocket()
{
//
// TODO: 在此处添加构造函数逻辑
//
}
private string _IP;
public string IP{
get { return _IP; }
set { _IP = value; }
}
private int _Post;
public int Post
{
get { return _Post; }
set { _Post = value; }
}
public string info()
{
string serverIP=this.IP;
string serverPost=this.Post;
return "serverIP:"+serverIP+" serverPost:"+serverPost;
}
}
调用:
xlxcnSocket serverInfo=new xlxcnSocket();
serverInfo.IP="127.0.0.1";
serverInfo.Post="80";
Response.Write(serverInfo.info());