Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

VBÏÂÈçºÎ±àдCRCУÑé³ÌÐò

 VBÏÂÈçºÎ±àдCRCУÑé³ÌÐò
¡¡¡¡Ëæ׿ÆËã»ú¼¼ÊõµÄ²»¶Ï·¢Õ¹£¬ÔÚÏÖ´ú¹¤ÒµÖУ¬ÀûÓÃ΢»ú½øÐÐÊý¾ÝͨѶµÄ¹¤Òµ¿ØÖÆÓ¦ÓõÃÒ²Ô½À´Ô½¹ã·º¡£ÓÉÓÚ´«Êä¾àÀë¡¢ÏÖ³¡×´¿öµÈÖî¶à¿ÉÄܳöÏÖµÄÒòËØÓ°Ï죬¼ÆËã»úÓëÊÜ¿ØÉ豸֮¼äµÄͨѶÊý¾Ý³£»á·¢ÉúÎÞ·¨Ô¤²âµÄ´íÎó¡£ÎªÁË·ÀÖ¹´íÎóËù´øÀ´µÄÓ°Ï죬һ°ãÔÚͨѶʱ²ÉÈ¡Êý¾ÝУÑéµÄ°ì·¨£¬¶øÑ­»·ÈßÓàÂëУÑéÊÇ×î³£ÓõÄУÑé·½·¨Ö®Ò»¡£
Ò»¡¢Ñ­»·ÈßÓàÂëУÑéÔ­Àí
¡¡¡¡Ñ­»·ÈßÓàÂëУÑéÓ¢ÎÄÃû³ÆΪCyclical Redundancy Check£¬¼ò³ÆCRC¡£ËüÊÇÀûÓóý·¨¼°ÓàÊýµÄÔ­ÀíÀ´×÷´íÎóÕì²â£¨Error Detecting£©µÄ¡£Êµ¼ÊÓ¦ÓÃʱ£¬·¢ËÍ×°ÖüÆËã³öCRCÖµ²¢ËæÊý¾Ýһͬ·¢Ë͸ø½ÓÊÕ×°Ö㬽ÓÊÕ×°ÖöÔÊÕµ½µÄÊý¾ÝÖØмÆËãCRC²¢ÓëÊÕµ½µÄCRCÏà±È½Ï£¬ÈôÁ½¸öCRCÖµ²»Í¬£¬Ôò˵Ã÷Êý¾ÝͨѶ³öÏÖ´íÎó¡£
¸ù¾ÝÓ¦Óû·¾³ÓëÏ°¹ßµÄ²»Í¬£¬CRCÓÖ¿É·ÖΪÒÔϼ¸ÖÖ±ê×¼£º
¡¡¡¡¢ÙCRC-12Â룻
¡¡¡¡¢ÚCRC-16Â룻
¡¡¡¡¢ÛCRC-CCITTÂ룻
¡¡¡¡¢ÜCRC-32Âë¡£
¡¡¡¡CRC-12Âëͨ³£ÓÃÀ´´«ËÍ6-bit×Ö·û´®¡£CRC-16¼°CRC-CCITTÂëÔòÓÃÊÇÀ´´«ËÍ8-bit×Ö·û£¬ÆäÖÐCRC-16ΪÃÀ¹ú²ÉÓ㬶øCRC-CCITTΪŷÖÞ¹ú¼ÒËù²ÉÓá£CRC-32Âë´ó¶¼±»²ÉÓÃÔÚÒ»ÖÖ³ÆΪPoint-to-PointµÄͬ²½´«ÊäÖС£
ÏÂÃæÒÔ×î³£ÓõÄCRC-16ΪÀýÀ´ËµÃ÷ÆäÉú³É¹ý³Ì¡£
¡¡¡¡CRC-16ÂëÓÉÁ½¸ö×Ö½Ú¹¹³É£¬ÔÚ¿ªÊ¼Ê±CRC¼Ä´æÆ÷µÄÿһλ¶¼Ô¤ÖÃΪ1£¬È»ºó°ÑCRC¼Ä´æÆ÷Óë8-bitµÄÊý¾Ý½øÐÐÒì»ò£¬Ö®ºó¶ÔCRC¼Ä´æÆ÷´Ó¸ßµ½µÍ½øÐÐÒÆ룬ÔÚ×î¸ß루MSB£©µÄλÖò¹Á㣬¶ø×îµÍ루LSB£¬ÒÆλºóÒѾ­±»ÒƳöCRC¼Ä´æÆ÷£©Èç¹ûΪ1£¬Ôò°Ñ¼Ä´æÆ÷ÓëÔ¤¶¨ÒåµÄ¶àÏîʽÂë½øÐÐÒì»ò£¬·ñÔòÈç¹û LSBΪÁ㣬ÔòÎÞÐè½øÐÐÒì»ò¡£Öظ´ÉÏÊöµÄÓɸßÖÁµÍµÄÒÆλ8´Î£¬µÚÒ»¸ö8-bitÊý¾Ý´¦ÀíÍê±Ï£¬ÓôËʱCRC¼Ä´æÆ÷µÄÖµÓëÏÂÒ»¸ö8-bitÊý¾ÝÒì»ò²¢½øÐÐÈçÇ°Ò»¸öÊý¾ÝËƵÄ8´ÎÒÆλ¡£ËùÓеÄ×Ö·û´¦ÀíÍê³ÉºóCRC¼Ä´æÆ÷ÄÚµÄÖµ¼´Îª×îÖÕµÄCRCÖµ¡£
¡¡¡¡ÏÂÃæΪCRCµÄ¼ÆËã¹ý³Ì£º
¡¡¡¡1£®ÉèÖÃCRC¼Ä´æÆ÷£¬²¢¸øÆ丳ֵFFFF(hex)¡£
¡¡¡¡2£®½«Êý¾ÝµÄµÚÒ»¸ö8-bit×Ö·ûÓë16λCRC¼Ä´æÆ÷µÄµÍ8λ½øÐÐÒì»ò£¬²¢°Ñ½á¹û´æÈëCRC¼Ä´æÆ÷¡£
¡¡¡¡3£®CRC¼Ä´æÆ÷ÏòÓÒÒÆһ룬MSB²¹Á㣬ÒƳö²¢¼ì²éLSB¡£
¡¡¡¡4£®Èç¹ûLSBΪ0£¬Öظ´µÚÈý²½£»ÈôLSBΪ1£¬CRC¼Ä´æÆ÷Óë¶àÏîʽÂëÏàÒì»ò¡£
¡¡¡¡5£®Öظ´µÚ3ÓëµÚ4²½Ö±µ½8´ÎÒÆλȫ²¿Íê³É¡£´Ëʱһ¸ö8-bitÊý¾Ý´¦ÀíÍê±Ï¡£
¡¡¡¡6£®Öظ´µÚ2ÖÁµÚ5²½Ö±µ½ËùÓÐÊý¾ÝÈ«²¿´¦ÀíÍê³É¡£
¡¡¡¡7£®×îÖÕCRC¼Ä´æÆ÷µÄÄÚÈݼ´ÎªCRCÖµ¡£
¶þ¡¢ Ñ­»·ÈßÓàÂëУÑé³ÌÐòµÄ±àд
¡¡¡¡Ã÷°×ÁËCRCУÑéÂëµÄ²úÉú¹ý³Ì£¬±àдÆð³ÌÐòÀ´¾Í·Ç³£ÈÝÒ×ÁË¡£ÓÉÓÚVisual Basicµ


Ïà¹ØÎĵµ£º

VBÓï·¨¹æ·¶


Ò»¡£Êý¾ÝÀàÐÍ
 Byte 1
×Ö½Ú ÎÞ·ûºÅ
 Interger  2
×Ö½Ú
 Long  4
×Ö½Ú
 Float 4
×Ö½Ú
 Double 8
×Ö½Ú
 String
 Date
 Boolean
 Currency
 Variant
2.
±ä³¤×Ö·û´®ºÍ¶¨³¤×Ö·û
 
ϵͳĬÈϳõʼֵΪ¿Õ×Ö·û´®;
 
±ä³¤×Ö·û´®£ºdi ......

VB ¸ßËÙ±éÀú×¢²á±í

 Option Explicit
Private Type UNICODE_STRING
    Length As Integer
    MaximumLength As Integer
    Buffer As Long
End Type
Private Type OBJECT_ATTRIBUTES
    Length As Long
    RootDirectory As Long
   ......

vbʵÏÖĿ¼ÏÂËùÓÐÎļþÃûĿ¼Ãû³ÆµÄ»ñÈ¡

 Ç°¼¸ÈÕ£¬Óиö¸çÃÇ˵ÓкܶàµçÓ°£¬ÎÊÎÒÒª²»Òª£¿ÎÒ¾ÍÈÃËûÒ»¸öÒ»¸öµÄд¹ýÀ´£¬ÈøçÃÇÀÛ¸ö²»Çá¡£ËùÒÔ¾ÍÏë¼òµ¥Ð´¸ö³ÌÐò£¬»ñÈ¡Ò»ÏÂÎļþ¼ÐÏÂÃæµÄËùÓÐÎļþÃû³Æ£¬ÕâÑù¾Í¿ÉÒÔ½ÚÊ¡ºÜ¶àʱ¼äÁË¡£
Èí¼þÄØ£¬ÎÒÒѾ­ÉÏ´«µ½ÍøÕ¾ÁË£ºhttp://download.csdn.net/source/1802599
vb°æ±¾Ä¿Â¼»ñÈ¡Æ÷ 1.0£¨Áú¾í·ç³öÆ·£©
˵Ã÷£º
1.Ñ¡ºÃĿ¼ºó£ ......

VBÖÐShellºÍShellExecuteº¯ÊýµÄʹÓ÷½·¨ºÍÇø±ð

 Ð´ÁËÒ»¸övbµÄ³ÌÐò£¬ÓÃÀ´°ÑÔ­À´Ð´µÄ¼¸¸övbºÍvcµÄ³ÌÐòÕûºÏÆðÀ´¡£¾ÍÊÇʹÓÃShellº¯Êý¡£½á¹û·¢ÏÖ£¬vcµÄ³ÌÐò¿ÉÒԺܺõÄÏÔʾ£¬µ«vbдµÄÈ´Ò»ÔËÐоÍ×îС»¯ÁË¡£×Ðϸ²é¿´ÁËÒ»ÏÂÒÔÏÂÎÄÕ£¬²Å·¢ÏÖÔ­À´shellº¯ÊýµÄĬÈÏÏÔʾģʽÊÇwindowstyleÊǵÈÓÚvbMinimizedFocus¡£È»ºó¾ÍÊÇÖ±½Ó¼ÓÉÏÒ»¸övbNormalFocus¡£Ò»ÇÐok!  
vbµÄs ......

vbʹÓÃopen·½·¨¶ÁдÎļþ

 
vbʹÓÃopen·½·¨¶ÁдÎļþ
£¨Ò»£©´ò¿ªºÍ¹Ø±ÕÎļþ
¡¡¡¡1¡¢Ë³ÐòÎļþ
¡¡¡¡´ò¿ªË³ÐòÎļþ£¬ÎÒÃÇ¿ÉÒÔʹÓÃOpenÓï¾ä¡£ËüµÄ¸ñʽÈçÏ£º

Open pathname For [Input |Output |Append] As [#]filenumber [Len = buffersize]
¡¡¡¡ËµÃ÷£º
¡¡¡¡£¨1£©²ÎÊýpathname ±íʾҪ´ò¿ªµÄÎļþÃû£¬ÎļþÃû¿ÉÒÔ°üº¬ÓÐÇý¶¯Æ÷ºÍÄ¿ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ