当前位置: 首页 > news >正文

襄阳做网站公司哪家好网站空间在哪买

襄阳做网站公司哪家好,网站空间在哪买,做封面字体下载好的网站,wordpress 会员收费1、客户端应用程序开发 建立一个基于对话框的MFC应用程序#xff0c;创建的时候记得勾选【Windows Sockets】#xff0c;其 他的默认就行。 #xff08;1#xff09;、对话框如图所示#xff1a; #xff08;2#xff09;代码如下#xff1a; // ChatClientDlg.cpp …1、客户端应用程序开发 建立一个基于对话框的MFC应用程序创建的时候记得勾选【Windows Sockets】其 他的默认就行。 1、对话框如图所示 2代码如下 // ChatClientDlg.cpp : implementation file //#include stdafx.h #include ChatClient.h #include ChatClientDlg.h#ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] __FILE__; #endif/ // CAboutDlg dialog used for App Aboutclass CAboutDlg : public CDialog { public:CAboutDlg();// Dialog Data//{{AFX_DATA(CAboutDlg)enum { IDD IDD_ABOUTBOX };//}}AFX_DATA// ClassWizard generated virtual function overrides//{{AFX_VIRTUAL(CAboutDlg)protected:virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support//}}AFX_VIRTUAL// Implementation protected://{{AFX_MSG(CAboutDlg)//}}AFX_MSGDECLARE_MESSAGE_MAP() };CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD) {//{{AFX_DATA_INIT(CAboutDlg)//}}AFX_DATA_INIT }void CAboutDlg::DoDataExchange(CDataExchange* pDX) {CDialog::DoDataExchange(pDX);//{{AFX_DATA_MAP(CAboutDlg)//}}AFX_DATA_MAP }BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)//{{AFX_MSG_MAP(CAboutDlg)// No message handlers//}}AFX_MSG_MAP END_MESSAGE_MAP()/ // CChatClientDlg dialogCChatClientDlg::CChatClientDlg(CWnd* pParent /*NULL*/): CDialog(CChatClientDlg::IDD, pParent) {//{{AFX_DATA_INIT(CChatClientDlg)m_sWords _T();//}}AFX_DATA_INIT// Note that LoadIcon does not require a subsequent DestroyIcon in Win32m_hIcon AfxGetApp()-LoadIcon(IDR_MAINFRAME); }void CChatClientDlg::DoDataExchange(CDataExchange* pDX) {CDialog::DoDataExchange(pDX);//{{AFX_DATA_MAP(CChatClientDlg)DDX_Control(pDX, IDC_LIST_WORDS, m_ListWords);DDX_Control(pDX, IDC_IPADDRESS_SERVER, ServerIP);DDX_Control(pDX, IDC_BUTTON_SEND, m_ButtonSend);DDX_Control(pDX, IDC_BUTTON_CONNECT, m_ButtonConnect);DDX_Text(pDX, IDC_EDIT_WORDS, m_sWords);//}}AFX_DATA_MAP }BEGIN_MESSAGE_MAP(CChatClientDlg, CDialog)//{{AFX_MSG_MAP(CChatClientDlg)ON_WM_SYSCOMMAND()ON_WM_PAINT()ON_WM_QUERYDRAGICON()ON_BN_CLICKED(IDC_BUTTON_CONNECT, OnButtonConnect)ON_BN_CLICKED(IDC_BUTTON_SEND, OnButtonSend)ON_BN_CLICKED(IDC_BUTTON_CLEAR, OnButtonClear)ON_BN_CLICKED(IDC_BUTTON_ABOUT, OnButtonAbout)ON_BN_CLICKED(IDC_BUTTON_EXIT, OnButtonExit)//}}AFX_MSG_MAP END_MESSAGE_MAP()/ // CChatClientDlg message handlersBOOL CChatClientDlg::OnInitDialog() {CDialog::OnInitDialog();// Add About... menu item to system menu.// IDM_ABOUTBOX must be in the system command range.ASSERT((IDM_ABOUTBOX 0xFFF0) IDM_ABOUTBOX);ASSERT(IDM_ABOUTBOX 0xF000);CMenu* pSysMenu GetSystemMenu(FALSE);if (pSysMenu ! NULL){CString strAboutMenu;strAboutMenu.LoadString(IDS_ABOUTBOX);if (!strAboutMenu.IsEmpty()){pSysMenu-AppendMenu(MF_SEPARATOR);pSysMenu-AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);}}// Set the icon for this dialog. The framework does this automatically// when the applications main window is not a dialogSetIcon(m_hIcon, TRUE); // Set big iconSetIcon(m_hIcon, FALSE); // Set small icon// TODO: Add extra initialization herereturn TRUE; // return TRUE unless you set the focus to a control }void CChatClientDlg::OnSysCommand(UINT nID, LPARAM lParam) {if ((nID 0xFFF0) IDM_ABOUTBOX){CAboutDlg dlgAbout;dlgAbout.DoModal();}else{CDialog::OnSysCommand(nID, lParam);} }// If you add a minimize button to your dialog, you will need the code below // to draw the icon. For MFC applications using the document/view model, // this is automatically done for you by the framework.void CChatClientDlg::OnPaint() {if (IsIconic()){CPaintDC dc(this); // device context for paintingSendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);// Center icon in client rectangleint cxIcon GetSystemMetrics(SM_CXICON);int cyIcon GetSystemMetrics(SM_CYICON);CRect rect;GetClientRect(rect);int x (rect.Width() - cxIcon 1) / 2;int y (rect.Height() - cyIcon 1) / 2;// Draw the icondc.DrawIcon(x, y, m_hIcon);}else{CDialog::OnPaint();} }// The system calls this to obtain the cursor to display while the user drags // the minimized window. HCURSOR CChatClientDlg::OnQueryDragIcon() {return (HCURSOR) m_hIcon; }void CChatClientDlg::OnButtonConnect() {// TODO: Add your control notification handler code hereBYTE nFild[4];UpdateData();ServerIP.GetAddress(nFild[0],nFild[1],nFild[2],nFild[3]);CString sIP;sIP.Format(%d.%d.%d.%d,nFild[0],nFild[1],nFild[2],nFild[3]);m_ClientSocket.Create(); // 创建客户端Socketm_ClientSocket.Connect(sIP,14875);}void CChatClientDlg::OnButtonSend() {// TODO: Add your control notification handler code hereUpdateData();m_ClientSocket.Send(m_sWords,m_sWords.GetLength()); //获取文本长度m_ListWords.AddString(发送m_sWords); //显示发送文件长度记录m_ListWords.SetTopIndex(m_ListWords.GetCount()-1); }void CChatClientDlg::OnButtonClear() {// TODO: Add your control notification handler code herem_ListWords.ResetContent(); //清空聊天记录}void CChatClientDlg::OnButtonAbout() {// TODO: Add your control notification handler code hereCAboutDlg dlgAbout; dlgAbout.DoModal(); //显示关于对话框}void CChatClientDlg::OnButtonExit() {// TODO: Add your control notification handler code hereCDialog::OnCancel();}// ClientSocket.cpp : implementation file //#include stdafx.h #include ChatClient.h #include ClientSocket.h #include ChatClientDlg.h#ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] __FILE__; #endif/ // CClientSocketCClientSocket::CClientSocket() { }CClientSocket::~CClientSocket() { }// Do not edit the following lines, which are needed by ClassWizard. #if 0 BEGIN_MESSAGE_MAP(CClientSocket, CAsyncSocket)//{{AFX_MSG_MAP(CClientSocket)//}}AFX_MSG_MAP END_MESSAGE_MAP() #endif // 0/ // CClientSocket member functionsvoid CClientSocket::OnClose(int nErrorCode) {// TODO: Add your specialized code here and/or call the base class((CChatClientDlg *)(AfxGetApp()-m_pMainWnd))-m_ListWords.AddString(服务器端已经断开);((CChatClientDlg *)(AfxGetApp()-m_pMainWnd))-m_ListWords.SetTopIndex(((CChatClientDlg *)(AfxGetApp()-m_pMainWnd))-m_ListWords.GetCount()-1);((CChatClientDlg *)(AfxGetApp()-m_pMainWnd))-ServerIP.EnableWindow();((CChatClientDlg *)(AfxGetApp()-m_pMainWnd))-m_ButtonConnect.EnableWindow();((CChatClientDlg *)(AfxGetApp()-m_pMainWnd))-m_ButtonSend.EnableWindow(FALSE);Close();CAsyncSocket::OnClose(nErrorCode); }void CClientSocket::OnConnect(int nErrorCode) {// TODO: Add your specialized code here and/or call the base classif(nErrorCode) {AfxMessageBox(连接出现错误请您重新连接);return; }AsyncSelect(FD_READ|FD_WRITE|FD_CLOSE);((CChatClientDlg *)(AfxGetApp()-m_pMainWnd))-ServerIP.EnableWindow(FALSE);((CChatClientDlg *)(AfxGetApp()-m_pMainWnd))-m_ButtonConnect.EnableWindow(FALSE);((CChatClientDlg *)(AfxGetApp()-m_pMainWnd))-m_ButtonSend.EnableWindow();((CChatClientDlg *)(AfxGetApp()-m_pMainWnd))-m_ListWords.AddString(连接上服务器端);((CChatClientDlg *)(AfxGetApp()-m_pMainWnd))-m_ListWords.SetTopIndex(((CChatClientDlg *)(AfxGetApp()-m_pMainWnd))-m_ListWords.GetCount()-1);CAsyncSocket::OnConnect(nErrorCode); }void CClientSocket::OnReceive(int nErrorCode) {// TODO: Add your specialized code here and/or call the base classchar szTemp[250];int nReceive(szTemp,250);szTemp[n]0;CString sTemp;sTemp.Format(收到%s,szTemp);((CChatClientDlg *)(AfxGetApp()-m_pMainWnd))-m_ListWords.AddString(sTemp);((CChatClientDlg *)(AfxGetApp()-m_pMainWnd))-m_ListWords.SetTopIndex(((CChatClientDlg *)(AfxGetApp()-m_pMainWnd))-m_ListWords.GetCount()-1);CAsyncSocket::OnReceive(nErrorCode); }// ChatClientDlg.h : header file //#if !defined(AFX_CHATCLIENTDLG_H__69330A11_2EA5_4EAA_81ED_36AFA20E1E03__INCLUDED_) #define AFX_CHATCLIENTDLG_H__69330A11_2EA5_4EAA_81ED_36AFA20E1E03__INCLUDED_#include ClientSocket.h #if _MSC_VER 1000 #pragma once #endif // _MSC_VER 1000/ // CChatClientDlg dialogclass CChatClientDlg : public CDialog { // Construction public:CClientSocket m_ClientSocket;CChatClientDlg(CWnd* pParent NULL); // standard constructor// Dialog Data//{{AFX_DATA(CChatClientDlg)enum { IDD IDD_CHATCLIENT_DIALOG };CListBox m_ListWords;CIPAddressCtrl ServerIP;CButton m_ButtonSend;CButton m_ButtonConnect;CString m_sWords;//}}AFX_DATA// ClassWizard generated virtual function overrides//{{AFX_VIRTUAL(CChatClientDlg)protected:virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support//}}AFX_VIRTUAL// Implementation protected:HICON m_hIcon;// Generated message map functions//{{AFX_MSG(CChatClientDlg)virtual BOOL OnInitDialog();afx_msg void OnSysCommand(UINT nID, LPARAM lParam);afx_msg void OnPaint();afx_msg HCURSOR OnQueryDragIcon();afx_msg void OnButtonConnect();afx_msg void OnButtonSend();afx_msg void OnButtonClear();afx_msg void OnButtonAbout();afx_msg void OnButtonExit();//}}AFX_MSGDECLARE_MESSAGE_MAP() };//{{AFX_INSERT_LOCATION}} // Microsoft Visual C will insert additional declarations immediately before the previous line.#endif // !defined(AFX_CHATCLIENTDLG_H__69330A11_2EA5_4EAA_81ED_36AFA20E1E03__INCLUDED_)#if !defined(AFX_CLIENTSOCKET_H__D5AD111C_C151_4927_B75A_F84B49698C4B__INCLUDED_) #define AFX_CLIENTSOCKET_H__D5AD111C_C151_4927_B75A_F84B49698C4B__INCLUDED_#if _MSC_VER 1000 #pragma once #endif // _MSC_VER 1000 // ClientSocket.h : header file /// // CClientSocket command targetclass CClientSocket : public CAsyncSocket { // Attributes public:// Operations public:CClientSocket();virtual ~CClientSocket();// Overrides public:// ClassWizard generated virtual function overrides//{{AFX_VIRTUAL(CClientSocket)public:virtual void OnClose(int nErrorCode);virtual void OnConnect(int nErrorCode);virtual void OnReceive(int nErrorCode);//}}AFX_VIRTUAL// Generated message map functions//{{AFX_MSG(CClientSocket)// NOTE - the ClassWizard will add and remove member functions here.//}}AFX_MSG// Implementation protected: };///{{AFX_INSERT_LOCATION}} // Microsoft Visual C will insert additional declarations immediately before the previous line.#endif // !defined(AFX_CLIENTSOCKET_H__D5AD111C_C151_4927_B75A_F84B49698C4B__INCLUDED_)2、服务端应用程序开发 建立一个基于对话框的MFC应用程序创建的时候记得勾选【Windows Sockets】其 他的默认就行。 1、对话框如图所示 2代码如下 // ChatServerDlg.cpp : implementation file //#include stdafx.h #include ChatServer.h #include ChatServerDlg.h#ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] __FILE__; #endif/ // CAboutDlg dialog used for App Aboutclass CAboutDlg : public CDialog { public:CAboutDlg();// Dialog Data//{{AFX_DATA(CAboutDlg)enum { IDD IDD_ABOUTBOX };//}}AFX_DATA// ClassWizard generated virtual function overrides//{{AFX_VIRTUAL(CAboutDlg)protected:virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support//}}AFX_VIRTUAL// Implementation protected://{{AFX_MSG(CAboutDlg)//}}AFX_MSGDECLARE_MESSAGE_MAP() };CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD) {//{{AFX_DATA_INIT(CAboutDlg)//}}AFX_DATA_INIT }void CAboutDlg::DoDataExchange(CDataExchange* pDX) {CDialog::DoDataExchange(pDX);//{{AFX_DATA_MAP(CAboutDlg)//}}AFX_DATA_MAP }BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)//{{AFX_MSG_MAP(CAboutDlg)// No message handlers//}}AFX_MSG_MAP END_MESSAGE_MAP()/ // CChatServerDlg dialogCChatServerDlg::CChatServerDlg(CWnd* pParent /*NULL*/): CDialog(CChatServerDlg::IDD, pParent) {//{{AFX_DATA_INIT(CChatServerDlg)m_sWords _T();//}}AFX_DATA_INIT// Note that LoadIcon does not require a subsequent DestroyIcon in Win32m_hIcon AfxGetApp()-LoadIcon(IDR_MAINFRAME); }void CChatServerDlg::DoDataExchange(CDataExchange* pDX) {CDialog::DoDataExchange(pDX);//{{AFX_DATA_MAP(CChatServerDlg)DDX_Control(pDX, IDC_LIST_WORDS, m_ListWords);DDX_Control(pDX, IDC_BUTTON_SEND, m_ButtonSend);DDX_Text(pDX, IDC_EDIT_WORDS, m_sWords);//}}AFX_DATA_MAP }BEGIN_MESSAGE_MAP(CChatServerDlg, CDialog)//{{AFX_MSG_MAP(CChatServerDlg)ON_WM_SYSCOMMAND()ON_WM_PAINT()ON_WM_QUERYDRAGICON()ON_BN_CLICKED(IDC_BUTTON_SEND, OnButtonSend)ON_BN_CLICKED(IDC_BUTTON_CLEAR, OnButtonClear)ON_BN_CLICKED(IDC_BUTTON_ABOUT, OnButtonAbout)ON_BN_CLICKED(IDC_BUTTON_EXIT, OnButtonExit)//}}AFX_MSG_MAP END_MESSAGE_MAP()/ // CChatServerDlg message handlersBOOL CChatServerDlg::OnInitDialog() {CDialog::OnInitDialog();// Add About... menu item to system menu.// IDM_ABOUTBOX must be in the system command range.ASSERT((IDM_ABOUTBOX 0xFFF0) IDM_ABOUTBOX);ASSERT(IDM_ABOUTBOX 0xF000);CMenu* pSysMenu GetSystemMenu(FALSE);if (pSysMenu ! NULL){CString strAboutMenu;strAboutMenu.LoadString(IDS_ABOUTBOX);if (!strAboutMenu.IsEmpty()){pSysMenu-AppendMenu(MF_SEPARATOR);pSysMenu-AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);}}// Set the icon for this dialog. The framework does this automatically// when the applications main window is not a dialogSetIcon(m_hIcon, TRUE); // Set big iconSetIcon(m_hIcon, FALSE); // Set small icon// TODO: Add extra initialization herem_ListenSocket.Create(14875);//创建监听Socket,端口号为14875m_ListenSocket.Listen(1);//开始监听只接收一个客户端return TRUE; // return TRUE unless you set the focus to a control }void CChatServerDlg::OnSysCommand(UINT nID, LPARAM lParam) {if ((nID 0xFFF0) IDM_ABOUTBOX){CAboutDlg dlgAbout;dlgAbout.DoModal();}else{CDialog::OnSysCommand(nID, lParam);} }// If you add a minimize button to your dialog, you will need the code below // to draw the icon. For MFC applications using the document/view model, // this is automatically done for you by the framework.void CChatServerDlg::OnPaint() {if (IsIconic()){CPaintDC dc(this); // device context for paintingSendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);// Center icon in client rectangleint cxIcon GetSystemMetrics(SM_CXICON);int cyIcon GetSystemMetrics(SM_CYICON);CRect rect;GetClientRect(rect);int x (rect.Width() - cxIcon 1) / 2;int y (rect.Height() - cyIcon 1) / 2;// Draw the icondc.DrawIcon(x, y, m_hIcon);}else{CDialog::OnPaint();} }// The system calls this to obtain the cursor to display while the user drags // the minimized window. HCURSOR CChatServerDlg::OnQueryDragIcon() {return (HCURSOR) m_hIcon; }void CChatServerDlg::OnButtonSend() {// TODO: Add your control notification handler code hereUpdateData();m_ServerSocket.Send(m_sWords,m_sWords.GetLength()); //获取文本长度m_ListWords.AddString(发送m_sWords); //显示发送文件长度记录m_ListWords.SetTopIndex(m_ListWords.GetCount()-1); }void CChatServerDlg::OnButtonClear() {// TODO: Add your control notification handler code herem_ListWords.ResetContent();}void CChatServerDlg::OnButtonAbout() {// TODO: Add your control notification handler code hereCAboutDlg dlgAbout;dlgAbout.DoModal();}void CChatServerDlg::OnButtonExit() {// TODO: Add your control notification handler code hereCDialog::OnCancel();}// ServerSocket.cpp : implementation file //#include stdafx.h #include ChatServer.h #include ServerSocket.h #include ChatServerDlg.h#ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] __FILE__; #endif/ // CServerSocketCServerSocket::CServerSocket() { }CServerSocket::~CServerSocket() { }// Do not edit the following lines, which are needed by ClassWizard. #if 0 BEGIN_MESSAGE_MAP(CServerSocket, CAsyncSocket)//{{AFX_MSG_MAP(CServerSocket)//}}AFX_MSG_MAP END_MESSAGE_MAP() #endif // 0/ // CServerSocket member functionsvoid CServerSocket::OnReceive(int nErrorCode) {// TODO: Add your specialized code here and/or call the base classchar szTemp[250];int nReceive(szTemp,250);szTemp[n]0;CString sTemp;sTemp.Format(收到%s,szTemp);((CChatServerDlg *)(AfxGetApp()-m_pMainWnd))-m_ListWords.AddString(sTemp);((CChatServerDlg *)(AfxGetApp()-m_pMainWnd))-m_ListWords.SetTopIndex(((CChatServerDlg *)(AfxGetApp()-m_pMainWnd))-m_ListWords.GetCount()-1);CAsyncSocket::OnReceive(nErrorCode); }void CServerSocket::OnClose(int nErrorCode) {// TODO: Add your specialized code here and/or call the base class((CChatServerDlg *)(AfxGetApp()-m_pMainWnd))-m_ListWords.AddString(客户端已经断开);((CChatServerDlg *)(AfxGetApp()-m_pMainWnd))-m_ListWords.SetTopIndex(((CChatServerDlg *)(AfxGetApp()-m_pMainWnd))-m_ListWords.GetCount()-1);((CChatServerDlg *)(AfxGetApp()-m_pMainWnd))-m_ButtonSend.EnableWindow(FALSE);Close();CAsyncSocket::OnClose(nErrorCode); }// ListenSocket.cpp : implementation file //#include stdafx.h #include ChatServer.h #include ListenSocket.h #include ChatServerDlg.h#ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] __FILE__; #endif/ // CListenSocketCListenSocket::CListenSocket() { }CListenSocket::~CListenSocket() { }// Do not edit the following lines, which are needed by ClassWizard. #if 0 BEGIN_MESSAGE_MAP(CListenSocket, CAsyncSocket)//{{AFX_MSG_MAP(CListenSocket)//}}AFX_MSG_MAP END_MESSAGE_MAP() #endif // 0/ // CListenSocket member functionsvoid CListenSocket::OnAccept(int nErrorCode) {// TODO: Add your specialized code here and/or call the base class// 接受客户端连接请求Accept(((CChatServerDlg *)(AfxGetApp()-m_pMainWnd))-m_ServerSocket);// 启用发送按钮((CChatServerDlg *)(AfxGetApp()-m_pMainWnd))-m_ButtonSend.EnableWindow();((CChatServerDlg *)(AfxGetApp()-m_pMainWnd))-m_ServerSocket.AsyncSelect(FD_READ|FD_WRITE|FD_CLOSE);((CChatServerDlg *)(AfxGetApp()-m_pMainWnd))-m_ListWords.AddString(接受客户端连接请求);((CChatServerDlg *)(AfxGetApp()-m_pMainWnd))-m_ListWords.SetTopIndex(((CChatServerDlg *)(AfxGetApp()-m_pMainWnd))-m_ListWords.GetCount()-1);CAsyncSocket::OnAccept(nErrorCode); }// ChatServerDlg.h : header file //#if !defined(AFX_CHATSERVERDLG_H__C592DFC5_F66D_405E_84CB_F9AD0C5B55E1__INCLUDED_) #define AFX_CHATSERVERDLG_H__C592DFC5_F66D_405E_84CB_F9AD0C5B55E1__INCLUDED_#include ListenSocket.h // Added by ClassView #include ServerSocket.h // Added by ClassView #if _MSC_VER 1000 #pragma once #endif // _MSC_VER 1000/ // CChatServerDlg dialogclass CChatServerDlg : public CDialog { // Construction public:CServerSocket m_ServerSocket;CListenSocket m_ListenSocket;CChatServerDlg(CWnd* pParent NULL); // standard constructor// Dialog Data//{{AFX_DATA(CChatServerDlg)enum { IDD IDD_CHATSERVER_DIALOG };CListBox m_ListWords;CButton m_ButtonSend;CString m_sWords;//}}AFX_DATA// ClassWizard generated virtual function overrides//{{AFX_VIRTUAL(CChatServerDlg)protected:virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support//}}AFX_VIRTUAL// Implementation protected:HICON m_hIcon;// Generated message map functions//{{AFX_MSG(CChatServerDlg)virtual BOOL OnInitDialog();afx_msg void OnSysCommand(UINT nID, LPARAM lParam);afx_msg void OnPaint();afx_msg HCURSOR OnQueryDragIcon();afx_msg void OnButtonSend();afx_msg void OnButtonClear();afx_msg void OnButtonAbout();afx_msg void OnButtonExit();//}}AFX_MSGDECLARE_MESSAGE_MAP() };//{{AFX_INSERT_LOCATION}} // Microsoft Visual C will insert additional declarations immediately before the previous line.#endif // !defined(AFX_CHATSERVERDLG_H__C592DFC5_F66D_405E_84CB_F9AD0C5B55E1__INCLUDED_)#if !defined(AFX_SERVERSOCKET_H__2CC46D77_F46D_4068_8FB4_A831DF5A0201__INCLUDED_) #define AFX_SERVERSOCKET_H__2CC46D77_F46D_4068_8FB4_A831DF5A0201__INCLUDED_#if _MSC_VER 1000 #pragma once #endif // _MSC_VER 1000 // ServerSocket.h : header file /// // CServerSocket command targetclass CServerSocket : public CAsyncSocket { // Attributes public:// Operations public:CServerSocket();virtual ~CServerSocket();// Overrides public:// ClassWizard generated virtual function overrides//{{AFX_VIRTUAL(CServerSocket)public:virtual void OnReceive(int nErrorCode);virtual void OnClose(int nErrorCode);//}}AFX_VIRTUAL// Generated message map functions//{{AFX_MSG(CServerSocket)// NOTE - the ClassWizard will add and remove member functions here.//}}AFX_MSG// Implementation protected: };///{{AFX_INSERT_LOCATION}} // Microsoft Visual C will insert additional declarations immediately before the previous line.#endif // !defined(AFX_SERVERSOCKET_H__2CC46D77_F46D_4068_8FB4_A831DF5A0201__INCLUDED_)#if !defined(AFX_LISTENSOCKET_H__15870D2E_7268_4EC7_9B2F_DCA2BFBE89BC__INCLUDED_) #define AFX_LISTENSOCKET_H__15870D2E_7268_4EC7_9B2F_DCA2BFBE89BC__INCLUDED_#if _MSC_VER 1000 #pragma once #endif // _MSC_VER 1000 // ListenSocket.h : header file /// // CListenSocket command targetclass CListenSocket : public CAsyncSocket { // Attributes public:// Operations public:CListenSocket();virtual ~CListenSocket();// Overrides public:// ClassWizard generated virtual function overrides//{{AFX_VIRTUAL(CListenSocket)public:virtual void OnAccept(int nErrorCode);//}}AFX_VIRTUAL// Generated message map functions//{{AFX_MSG(CListenSocket)// NOTE - the ClassWizard will add and remove member functions here.//}}AFX_MSG// Implementation protected: };///{{AFX_INSERT_LOCATION}} // Microsoft Visual C will insert additional declarations immediately before the previous line.#endif // !defined(AFX_LISTENSOCKET_H__15870D2E_7268_4EC7_9B2F_DCA2BFBE89BC__INCLUDED_)3、在客户端填写本机的地址127.0.0.1单击【连接】按钮进行测试运行效果如下
http://www.sadfv.cn/news/91885/

相关文章:

  • 卖保健品可以自己做网站卖吗做微信公众号第三网站
  • 个人网站做交易类的赚钱吗用php做的大型网站有哪些
  • 扬州网站开发公司电话茶叶网站建设模板
  • 四川省建设领域信用系统网站专业的google推广公司
  • 外贸企业网站红色风格哪里有未成年做的网站
  • 网站如何做优化排名电子政务网站建设的实验体会
  • php网站开发教程网怎么注册公司公众号微信号
  • 网站分屏布局设计东莞市企业网站制作服务机构
  • 如何做好一个企业网站设计新闻类网站排版网站建设
  • 电影网站如何做长尾关键词百度贴吧论坛
  • 做视频网站弹窗wordpress多重筛选并排序
  • 成都招聘网站制作帝国系统做企业网站
  • gis做图网站wordpress加载js
  • 律师事务所网站模板国外的自建网站怎么做
  • 淮安新网站制作郑州工程网官网最新版入口
  • 信阳百度推广公司电话东营网站搜索引擎优化
  • 网站开发人员岗位seo是什么地方
  • 营销型网站建设费用怎么这么大网站首页的导航栏
  • 优秀产品设计案例江门搜狗网站推广优化
  • 网站主题下载微信支付 网站开发
  • 建外做网站的公司平台设计是什么
  • 如何进行网站设计中国市场网
  • 阜康网站建设创建公众号的流程
  • 东台做网站哪家便宜网店推广方案范文
  • 高端定制网站开发需要多少钱色彩网站设计师
  • 网站开发三大元素如何设计网站中的上传功能
  • 基于html的个人网站的设计与实现论文正保建设工程教育网官网
  • 开源网站官网免费申请域名的步骤
  • 用wordpress建立的网站吗泰安
  • 做外贸有那些网站平台米拓cms 网站模板在哪