大家好如何用VB直接读出16进制数据,看如下C代码,如何换成VB代码,求助!!
# include <stdio.h>
struct tag{ unsigned short int code; unsigned short int baol; unsigned short int attr; };
int main( void ) { FILE *fp; struct tag item;
printf( "sizeof tag: [%d]\n", sizeof(struct tag) ); fp = fopen( "D:\\Share\\6Zoneserver\\ZoneData\\npc\\3.itm", "rb" ); if ( fp == NULL ) { fprintf( stderr, "open failed!\n" ); return -1; }
while( !feof(fp) ) { fread( &item, sizeof(item), 1, fp ); fprintf( stderr, "物品代码:[%d], 暴率:[%d], 属性:[%d]\n", item.code, item.baol, item.attr ); } fclose(fp);
return 1; } 这个上面是C的代码如何改成VB的啊,可以直接读出16进制数据,谢谢高手们请指点!!!