发表于:2002-07-31 17:37:00
1楼
´«ËÍÎļþ¿Ï¶¨ÊÇÒª·Ö½âºóÔÙ´«µÄ£¬»ùÓÚSOCKETµÄÎļþ´«Ëͺܼòµ¥£¬¸½¼þÀïÊÇÒ»¸ö¼òµ¥µÄÀý×Ó£¬ÓÐÔÂë¡£·½·¨£ºÏÈ¿ªSERVER£¬ºó¿ªCLIENT£¬È»ºóÔÚSERVER ¶ËÑ¡ÔñÒ»¸öÎļþ£¬ÔÚCLIENT ÊäÈë±¾»úIP£¬¼´¿É½ÓÊÕ¡£
»ùÓÚSOCKETµÄÎļþ´«ËͺÃ×ö£¬SERVER´¦ÓÚ¼àÌý£¬CLIENTÏìÓ¦ºó¿ªÊ¼´«Îļþ£¬ÏÈ´«Í·ÐÅÏ¢
sockRecv.Send(&StreamFileInfo,sizeof(SOCKET_STREAM_FILE_INFO));
È»ºóÖ±½Ó´«¾Í¿ÉÒÔÁË
while(dwRead<StreamFileInfo.nFileSizeLow)
{
byte* data = new byte[1024];
UINT dw=myFile.Read(data, 1024);
sockRecv.Send(data, dw);
dwRead+=dw;
}
¶øÈç¹û»ùÓÚCAN×ÜÏߣ¬Í·ÐÅÏ¢¶¼ÎÞ·¨´«¹ýÈ¥.