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µ
Ïà¹ØÎĵµ£º
Ò»¡£Êý¾ÝÀàÐÍ
Byte 1
×Ö½Ú ÎÞ·ûºÅ
Interger 2
×Ö½Ú
Long 4
×Ö½Ú
Float 4
×Ö½Ú
Double 8
×Ö½Ú
String
Date
Boolean
Currency
Variant
2.
±ä³¤×Ö·û´®ºÍ¶¨³¤×Ö·û
ϵͳĬÈϳõʼֵΪ¿Õ×Ö·û´®;
±ä³¤×Ö·û´®£ºdi ......
Ä¿µÄÕÆÎÕÒ»¸ö¼òµ¥µÄVB³ÌÐòµÄ½¨Á¢¡¢±à¼¡¢µ÷ÊÔ¡¢ÔËÐкͱ£´æµÄ·½·¨¡£
²Ù×÷²½Öè ¢Å½øÈëVB»·¾³£¬Ð½¨¹¤³Ì¡£·½·¨ÊÇ£ºÈç¹û³öÏ֓н¨¹¤³Ì”¶Ô»°¿ò£¬ÔòÑ¡Ôñ“±ê×¼.EXE”²¢µã»÷[´ò¿ª]°´Å¦£»»òÕßÖ±½Óµã»÷²Ëµ¥[Îļþ]-[н¨¹¤³Ì]¡£¶¼»á³öÏÖÒ»¸öÃûΪ“Form1”µÄд°Ìå¡£
¢Æ´Ó±ê×¼¿Ø¼þ¹¤¾ßÀ¸ÖÐÏò´°Ìå¼Ó ......
°ïÅóÓѸĵÄһС¶Î¹Ø¼ü´Ê·ÖÎö´úÂ룻 º¬Á½¸öµ¥´Ê¸´ºÏ¼ÆÊý
Private Function CollectWords() As Dictionary(Of String, Integer)
'Create a new dictionary
Dim table As New Dictionary(Of String, Integer)
'Prompt for the user
Console.WriteLine(
"Enter a line : ")
'Get the user's input
Dim input As St ......
ÄÚÈÝÌáÒªÕªÒª£º The software of visual basic developed by Microsoft corporation is becoming one of the main develop tools at today¡£ As it's remarkable peculiarity, the Grid control has very great practical and active use¡£ This topic discusses how to use the grid control of VB to develop prati ......
vbʹÓÃopen·½·¨¶ÁдÎļþ
£¨Ò»£©´ò¿ªºÍ¹Ø±ÕÎļþ
¡¡¡¡1¡¢Ë³ÐòÎļþ
¡¡¡¡´ò¿ªË³ÐòÎļþ£¬ÎÒÃÇ¿ÉÒÔʹÓÃOpenÓï¾ä¡£ËüµÄ¸ñʽÈçÏ£º
Open pathname For [Input |Output |Append] As [#]filenumber [Len = buffersize]
¡¡¡¡ËµÃ÷£º
¡¡¡¡£¨1£©²ÎÊýpathname ±íʾҪ´ò¿ªµÄÎļþÃû£¬ÎļþÃû¿ÉÒÔ°üº¬ÓÐÇý¶¯Æ÷ºÍÄ¿ ......