资源简介

这是自编的利用C语言实现的网络聊天室的源程序,通过简单的示例想大家展示基础的聊天室程序,希望对大家有所帮助,也希望能有高手指正提点。

资源截图

代码片段和文件信息

#include
#include“resource.h“
#include“Chat_RoomC.h“

int APIENTRY WinMain(HINSTANCE hInstanceHINSTANCE hPrevInstance
 LPSTR lpCmdLineint nCmdShow)
{
DialogBox(hInstance(LPCTSTR)“DIALOG1“NULL(DLGPROC)Hostname_ipDlgPro);

return(TRUE);
}


BOOL APIENTRY Hostname_ipDlgPro(HWND hDlgUINT message
WPARAM wParamLPARAM lParam)
{
switch(message)
{
case WM_INITDIALOG:
WSA_return=WSAStartup(0x0002&WSAData);
if(WSA_return!=0)
{
MessageBox(NULL“初始化失败!““警告!“MB_OK);
WSACleanup();
}
if(client_hSocket!=0)
{
closesocket(client_hSocket);
client_hSocket=0;
}
if(client_hSocket==0)
{

if((client_hSocket=socket(AF_INETSOCK_DGRAM0))==SOCKET_ERROR)
MessageBox(NULL“建立套接字失败!““警告!“

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

    ..AD...         0  2007-09-03 09:36  Chat_RoomC1

     文件      18336  2006-03-27 20:36  Chat_RoomC1\Chat_RoomC.aps

     文件       1683  2004-05-23 00:00  Chat_RoomC1\Chat_RoomC.c

     文件       4168  2006-04-08 19:04  Chat_RoomC1\Chat_RoomC.dsp

     文件        543  2004-05-14 00:00  Chat_RoomC1\Chat_RoomC.dsw

     文件        303  2004-05-14 00:00  Chat_RoomC1\Chat_RoomC.h

     文件      66560  2007-09-03 09:36  Chat_RoomC1\Chat_RoomC.ncb

     文件      60928  2007-09-03 09:36  Chat_RoomC1\Chat_RoomC.opt

     文件       1536  2007-09-03 09:34  Chat_RoomC1\Chat_RoomC.plg

     文件       3273  2004-05-23 00:00  Chat_RoomC1\Chat_RoomC.rc

    ..AD...         0  2007-09-03 09:36  Chat_RoomC1\Debug

     文件        778  2004-05-15 00:00  Chat_RoomC1\resource.h

    ..AD...         0  2006-09-01 16:25  Chat_RoomC2

     文件      18428  2004-10-15 00:00  Chat_RoomC2\Chat_RoomC.aps

     文件       1748  2004-05-23 00:00  Chat_RoomC2\Chat_RoomC.c

     文件       4164  2004-05-14 00:00  Chat_RoomC2\Chat_RoomC.dsp

     文件        543  2004-05-14 00:00  Chat_RoomC2\Chat_RoomC.dsw

     文件        303  2004-05-15 00:00  Chat_RoomC2\Chat_RoomC.h

     文件      58368  2006-03-27 20:48  Chat_RoomC2\Chat_RoomC.ncb

     文件      66048  2006-03-27 20:48  Chat_RoomC2\Chat_RoomC.opt

     文件        254  2006-03-27 20:27  Chat_RoomC2\Chat_RoomC.plg

     文件       3324  2004-05-23 00:00  Chat_RoomC2\Chat_RoomC.rc

    ..AD...         0  2006-09-01 16:25  Chat_RoomC2\Debug

     文件        735  2004-05-23 00:00  Chat_RoomC2\resource.h

    ..AD...         0  2006-09-01 16:25  Chat_RoomC3

     文件      18624  2006-06-29 09:27  Chat_RoomC3\Chat_RoomC.aps

     文件       2497  2004-05-24 00:00  Chat_RoomC3\Chat_RoomC.c

     文件       4168  2004-10-15 00:00  Chat_RoomC3\Chat_RoomC.dsp

     文件        543  2004-05-14 00:00  Chat_RoomC3\Chat_RoomC.dsw

     文件        405  2004-05-24 00:00  Chat_RoomC3\Chat_RoomC.h

............此处省略46个文件信息

评论

共有 条评论