|
C#聊天程序(4) ShowUsage(); return false; } return true; } // Show sample usage private static void ShowUsage(){ MessageBox.Show("WinTalk [switch] [parameters...]\n\n"+ " /L [port]\t\t-- Listens on a port. Default: 5150\n"+ " /C [address] [port]\t-- Connects to an address and port.\n\n"+ "Example Server - \n"+ "Wintalk /L\n\n"+ "Example Client - \n"+ "Wintalk /C ServerMachine 5150","WinTalk Usage"); } } // UI class for the sample class TalkForm:Form { public TalkForm(Talker talker) { // Associate for method with the talker object this.talker = talker; talker.Notifications += new Talker.NotificationCallback(HandleTalkerNotifications); // Create a UI elements Splitter talkSplitter = new Splitter(); Panel talkPanel = new Panel(); receiveText = new TextBox();
|