Imports System
Ports Public Class Form1 Dim file_ending() As Byte = System
Encoding
Default
GetBytes("file_send_over") '将传输结束标志以二进制存放在file_ending 中 Dim file_name_ending() As Byte = System
Encoding
Default
GetBytes("/") '将文件名结束标志存放在file_name_ending 中 Dim file_rec_byt(10485760) As Byte '设置缓存大小为10M Dim file_name_byt(50) As Byte '设置文件名缓存大小为50 字节 Dim file_name_count As UInt16 = 0 '文件名计数 Dim file_rec_count As UInt32 = 0 '文件内容计数 Dim file_ok As Boolean = False '文件传输完成标志 Dim flag As Boolean = True '文件名传输未完成标志 Dim st As Boolean = True '显示“正在接收文件”用标志 Dim file_name_sa(2000) As String Dim file_name_sa_cou As Integer = 0 Public Delegate Sub data_rec() Public Sub wait(ByVal t) '延迟,单位 ms Application
DoEvents() Threading
Thread
Sleep(t) End Sub