请教,用UDP协议实现文件传送,vb 代码的
来源:百度知道 编辑:UC知道 时间:2024/06/14 17:18:19
可一直传送出问题
带个例子吧,
可以发送到我邮箱,378200901@qq.com
米有人回答,我又不知道,你们两个我该给谁分,咋办??
Option Explicit
Dim GetFileNum As Integer
Dim LenFile As Long
Dim Sendbaye() As Byte '发送的包
'===============================
'udp传文件
'作者: 影子
'以下是客户端
'================================
Private Sub Command1_Click()
GetFileNum = FreeFile '取得未使用的文件号
LenFile = FileLen("d:\aa.rar") '获得需传送的文件的长度
Open "d:\aa.rar" For Binary As #GetFileNum '打开需传送的文件
Command1.Enabled = False
' 传送文件
Call TCPSendFile(frmmain.Winsock0, GetFileNum, SplitFile)
Text1.Text = Now
End Sub
Private Sub Form_Load()
frmmain.Winsock0.RemoteHost = "127.0.0.1" '服务器ip
frmmain.Winsock0.RemotePort = 5698
End Sub
'========================