VB °æ (¾«»ªÇø)
·¢ÐÅÈË: bloom (©À©Á©Â©Ã©Ä©Æ©Ç¨), ÐÅÇø: VB
±ê Ìâ: ReadFile(Îļþ´¦Àí)(תÔØ)
·¢ÐÅÕ¾: ¹þ¹¤´ó×϶¡Ïã (2000Äê09ÔÂ07ÈÕ18:40:27 ÐÇÆÚËÄ), תÐÅ
¡¾ ÒÔÏÂÎÄ×ÖתÔØ×Ô cnTemp ÌÖÂÛÇø ¡¿
¡¾ ÔÎÄÓÉ bloom Ëù·¢±í ¡¿
·¢ÐÅÈË: yucheng (ÎÞ»°¿É˵), ÐÅÇø: VisualBasic
·¢ÐÅÕ¾: BBS ˮľÇ廪վ (Sat Apr 8 02:03:22 2000) WWW-POST
ReadFile
VBÉùÃ÷
Declare Function ReadFile Lib "kernel32" Alias "ReadFile" (ByVal hFile As
Long, lpBuffer As Any, ByVal nNumberOfBytesToRead As Long, lpNumberOfBytesRead
As Long, lpOverlapped As OVERLAPPED) As Long
˵Ã÷
´ÓÎļþÖжÁ³öÊý¾Ý¡£Óëlreadº¯ÊýÏà±È£¬Õâ¸öº¯ÊýÒªÃ÷ÏÔÁé»îµÄ¶à¡£¸Ãº¯ÊýÄܹ»²Ù×÷ͨÐÅ
É豸¡¢¹ÜµÀ¡¢Ì×½Ó×ÖÒÔ¼°ÓʲÛ
·µ»ØÖµ
Long£¬·ÇÁã±íʾ³É¹¦£¬Áã±íʾʧ°Ü¡£»áÉèÖÃGetLastError¡£ÈçÆô¶¯µÄÊÇÒ»´ÎÒì²½¶Á²Ù×÷£¬
Ôòº¯Êý»á·µ»ØÁãÖµ£¬²¢½«ERROR_IO_PENDINGÉèÖóÉGetLastErrorµÄ½á¹û¡£Èç½á¹û²»ÊÇÁãÖµ
£¬µ«¶ÁÈëµÄ×Ö½ÚÊýСÓÚnNumberOfBytesToRead²ÎÊýÖ¸¶¨µÄÖµ£¬±íÃ÷ÔçÒѵִïÁËÎļþµÄ½áβ
²ÎÊý±í
²ÎÊý ÀàÐͼ°ËµÃ÷
hFile Long£¬ÎļþµÄ¾ä±ú
lpBuffer Any£¬ÓÃÓÚ±£´æ¶ÁÈëÊý¾ÝµÄÒ»¸ö»º³åÇø
nNumberOfBytesToRead Long£¬Òª¶ÁÈëµÄ×Ö·ûÊý
lpNumberOfBytesRead Long£¬´ÓÎļþÖÐʵ¼Ê¶ÁÈëµÄ×Ö·ûÊý
lpOverlapped OVERLAPPED£¬ÈçÎļþ´ò¿ªÊ±Ö¸¶¨ÁËFILE_FLAG_OVERLAPPED£¬ÄÇô±ØÐëÓÃÕâ
¸ö²ÎÊýÒýÓÃÒ»¸öÌØÊâµÄ½á¹¹¡£ÄǸö½á¹¹¶¨ÒåÁËÒ»´ÎÒì²½¶ÁÈ¡²Ù×÷¡£·ñÔò£¬Ó¦½«Õâ¸ö²ÎÊýÉè
ΪNULL£¨½«º¯ÊýÉùÃ÷³ÉByVal As Long£¬²¢´«µÝÁãÖµ£©
×¢½â
²¢·ÇÿÖÖ²Ù×÷ϵͳ¶¼Ö§³Ö¶ÔÿÖÖÉ豸½øÐÐÒì²½²Ù×÷¡£Windows 95²»Ö§³Ö¶ÔÒ»¸ö´ÅÅÌÎļþ½ø
ÐÐÒì²½¶Á²Ù×÷£¨Öظ´¶Á£©
--
--
¡î À´Ô´:£®¹þ¹¤´ó×϶¡Ïã bbs.hit.edu.cn£®[FROM: blo0m.bbs@smth.org]
--
¡ù תÔØ:£®¹þ¹¤´ó×϶¡Ïã bbs.hit.edu.cn£®[FROM: 202.118.247.254]
Powered by KBS BBS 2.0 (http://dev.kcn.cn)
Ò³ÃæÖ´ÐÐʱ¼ä£º3.544ºÁÃë