Main.cpp
上传用户:popouu88
上传日期:2013-02-11
资源大小:2894k
文件大小:3k
源码类别:

IP电话/视频会议

开发平台:

Visual C++

  1. #include "Server.h"
  2. #include "stdio.h"
  3. void Welcome( void )
  4. {
  5. printf( " =================================================n" );
  6. printf( "|                                                 |n" );
  7. printf( "|                                                 |n" );
  8. printf( "|    欢迎使用赛力视频会议中央管理服务器系统V1.0   |n" );
  9. printf( "|                                                 |n" );
  10. printf( "|                                                 |n" );
  11. printf( "|           要退出系统,请输入  exit              |n" );
  12. printf( "|                                                 |n" );
  13. printf( "|                                                 |n" );
  14. printf( "|         切勿通过直接关闭窗口来退出本系统        |n" );
  15. printf( "|                                                 |n" );
  16. printf( "|                                                 |n" );
  17. printf( "|                  2004年06月04日                 |n" );
  18. printf( "|                                                 |n" );
  19. printf( "|                                                 |n" );
  20. printf( " =================================================nn" );
  21. }
  22. void PrintMsg( void )
  23. {
  24. printf( " ==========================================n" );
  25. printf( "|                                          |n" );
  26. printf( "|                                          |n" );
  27. printf( "|   输入无效命令,要退出系统,请输入exit   |n" );
  28. printf( "|                                          |n" );
  29. printf( "|                                          |n" );
  30. printf( " ==========================================nn" );
  31. }
  32. void GoodBye( void )
  33. {
  34. printf( " ==========================================n" );
  35. printf( "|                                          |n" );
  36. printf( "|                                          |n" );
  37. printf( "|               服务器已经退出             |n" );
  38. printf( "|                                          |n" );
  39. printf( "|                                          |n" );
  40. printf( " ==========================================nn" );
  41. }
  42. void main( void )
  43. {
  44. CServer server;
  45. Welcome( );
  46. if( server.Run( 8000 ) )
  47. {
  48. for( ;; )
  49. {
  50. char cmd[20];
  51. gets( cmd );
  52. for( int i = 0 ; cmd [ i ] ; i ++ )
  53. if( ::isupper( cmd[ i ] ) ) 
  54. cmd[ i ] = ::tolower( cmd[ i ] );
  55. if( ! strcmp( cmd , "exit" ) )
  56. break;
  57. PrintMsg( );
  58. }
  59. }
  60. server.Stop( );
  61. GoodBye( );
  62. }