因为使用VBA,使用了 b4a 的前缀模式传输数据。但是 我查了论坛没有找到VBA VB6的代码,但是有VB.net的代码。 但是 VB.net有很多VBA VB6 没有的新功能和函数。我用了很多时间去尝试。最终我成功的使用前缀模式发送文件成功。我希望分享我的代码,帮助新的朋友。
同时希望论坛能提供一下更详细的指导。
1、文件名的长度,VB6, 4个字符,32位(倒序)
2、文件名,vb6 string --> utf-8,长度为文件名长度
3、STREAM_PREFIX标志,vb6 4个字符,long(倒序)
4、文件数据长度,vb6(不支持)8个字符,64位,我只用了最后4位 Long(倒序)
6、文件数据
7、Adler-32校验码,vb6( 不支持)8个字符,64位,我只用了最后4位 Long(正序)
上面的正序,是指VB6 中的数字存储模式:Long 类型,从左边位,开始存储数据,而V4A的socket是从右开始读取数据的。
代码,我将完善好后在上传给大家。
=================
Because of the use of VBA, the prefix mode of b4a is used to transmit data. But I checked the forum did not find VBA VB6 code, but there is VB. net code. But VB.net has many new functions and functions that VBA VB6 does not have. I spent a lot of time trying. Eventually, I succeeded in sending files in prefix mode. I want to share my code and help new friends.
At the same time, I hope the forum can provide more detailed guidance.
1. File name length, VB6, 4 characters, 32 bits (reverse order)
2. File name, VB6 string - > utf-8, length is file name length
3. STREAM_PREFIX flag, vb64 characters, long (reverse order)
4. File data length, VB6 (not supported) 8 characters, 64 bits, I only used the last 4 bits Long (reverse order)
6. Document data
7. Adler-32 check code, VB6 (unsupported) 8 characters, 64 bits, I only used the last 4 bits Long (positive order)
The positive order above refers to the digital storage mode in VB6: Long type, which stores data from the left bit, while V4A socket reads data from the right.
Code, I will improve it and upload it to you.
同时希望论坛能提供一下更详细的指导。
1、文件名的长度,VB6, 4个字符,32位(倒序)
2、文件名,vb6 string --> utf-8,长度为文件名长度
3、STREAM_PREFIX标志,vb6 4个字符,long(倒序)
4、文件数据长度,vb6(不支持)8个字符,64位,我只用了最后4位 Long(倒序)
6、文件数据
7、Adler-32校验码,vb6( 不支持)8个字符,64位,我只用了最后4位 Long(正序)
上面的正序,是指VB6 中的数字存储模式:Long 类型,从左边位,开始存储数据,而V4A的socket是从右开始读取数据的。
代码,我将完善好后在上传给大家。
=================
Because of the use of VBA, the prefix mode of b4a is used to transmit data. But I checked the forum did not find VBA VB6 code, but there is VB. net code. But VB.net has many new functions and functions that VBA VB6 does not have. I spent a lot of time trying. Eventually, I succeeded in sending files in prefix mode. I want to share my code and help new friends.
At the same time, I hope the forum can provide more detailed guidance.
1. File name length, VB6, 4 characters, 32 bits (reverse order)
2. File name, VB6 string - > utf-8, length is file name length
3. STREAM_PREFIX flag, vb64 characters, long (reverse order)
4. File data length, VB6 (not supported) 8 characters, 64 bits, I only used the last 4 bits Long (reverse order)
6. Document data
7. Adler-32 check code, VB6 (unsupported) 8 characters, 64 bits, I only used the last 4 bits Long (positive order)
The positive order above refers to the digital storage mode in VB6: Long type, which stores data from the left bit, while V4A socket reads data from the right.
Code, I will improve it and upload it to you.