.NET Framework提供了很多做网络通信的东西-Remoting、Socket(TCP/UDP),Web Services等等。作者之所以选择用Remoting来做,源于他确认这是最强大的工具。
public interface IServer
{
bool SignUp(string username,string password);
bool ChangePassword(string username,string curPassword,string newPassword);
bool SignIn(string username,string password,bool visible);
bool SignOut(string username);
bool IsVisible(string username);
bool AddContact(string username,string contact);
bool RemoveContact(string username,string contact);
ArrayList GetContacts(string username);
bool Send(string from,string to,string message);
LetterReceive Receive(string to);
ArrayList ReceiveOffline(string to);
}