|
C#聊天程序(2) Application.Run(form); } } // Parsed Argument Storage private static IPEndPoint endPoint; private static bool client; // Parse command line arguments private static bool ParseArgs(String[] args){ try{ if(args.Length == 0){ client = false; endPoint = new IPEndPoint(IPAddress.Any,5150); return true; } switch(Char.ToUpper(args[0][1])){ case 'L': int port = 5150; if(args.Length > 1){ port = Convert.ToInt32(args[1]); } endPoint = new IPEndPoint(IPAddress.Any,port); client = false;
|