打印本文 打印本文 关闭窗口 关闭窗口
VB实现局域网内的文件传输
作者:武汉SEO闵涛  文章来源:敏韬网  点击数2774  更新时间:2009/4/23 15:43:11  文章录入:mintao  责任编辑:mintao
    FileisOver = False

        Sendbyte = 0

       

    Case RemoteIsReadyMSG

        ''''如果文件还没有结束,继续传输

        If Not FileisOver Then

            Label1.Caption = "文件正在被传输>>>"

            SendChunk

        Else

            WinsockSend.SendData FileisOverMSG

        End If

    Case FileisOverMSG

        ''''主机处理

        Close #filehandle

       

        MsgBox ("文件传输成功!") ''''大家一起处理

       

        WinsockSend.SendData FileisOverMSG

       

        WinsockSend.Close

       

        cmdConnect.Enabled = True

       

        ProgressBar1.Value = 0

       

        cmdSend.Enabled = True

        Label1.Caption = "准备传输>>>"

    Case RemoteDenyMSG

        MsgBox ("用户终止了传输!")

        cmdSend.Enabled = True

        Label1.Caption = "准备传输>>>"

        Close #filehandle

    End Select

    Exit Sub

 

End Sub

 

本程序在WinXPSP1+VB6和Win2000SP4+VB6下面调试成功。

上一页  [1] [2] [3] 

打印本文 打印本文 关闭窗口 关闭窗口