关闭

VB 局域网传输工具(接收端)

2655人阅读 评论(0) 收藏 举报

VERSION 5.00
Object = "{248DD890-BB45-11CF-9ABC-0080C7E7B78D}#1.0#0"; "MSWINSCK.OCX"
Begin VB.Form frmMain
   BorderStyle     =   1  'Fixed Single
   Caption         =   "程序之家文件局域网传输器接收端 V1.0"
   ClientHeight    =   3825
   ClientLeft      =   45
   ClientTop       =   435
   ClientWidth     =   6870
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   ScaleHeight     =   3825
   ScaleWidth      =   6870
   StartUpPosition =   2  '屏幕中心
   Begin VB.Timer timerStatus
      Interval        =   3000
      Left            =   720
      Top             =   1920
   End
   Begin VB.CommandButton cmdExit
      Cancel          =   -1  'True
      Caption         =   "退出(&C)"
      Height          =   300
      Left            =   5910
      TabIndex        =   12
      Top             =   3360
      Width           =   840
   End
   Begin VB.TextBox textMu
      Alignment       =   2  'Center
      Height          =   270
      Left            =   5235
      TabIndex        =   9
      Text            =   "3"
      Top             =   720
      Width           =   345
   End
   Begin VB.CommandButton cmdSet
      Caption         =   "设置(&S)"
      Height          =   300
      Left            =   5910
      TabIndex        =   8
      Top             =   720
      Width           =   840
   End
   Begin VB.CheckBox checkConnect
      Caption         =   "等待连接(&W)"
      Height          =   225
      Left            =   4080
      TabIndex        =   4
      Top             =   360
      Value           =   1  'Checked
      Width           =   1290
   End
   Begin VB.TextBox textPath
      Height          =   1350
      Left            =   4080
      MultiLine       =   -1  'True
      TabIndex        =   3
      Top             =   1880
      Width           =   2670
   End
   Begin VB.CommandButton cmdBrowse
      Caption         =   "浏览(&B)"
      Height          =   300
      Left            =   5910
      TabIndex        =   2
      Top             =   1460
      Width           =   840
   End
   Begin VB.TextBox textPort
      Height          =   270
      Left            =   6120
      MaxLength       =   5
      TabIndex        =   1
      Text            =   "5300"
      Top             =   350
      Width           =   615
   End
   Begin VB.ListBox lstFiles
      Height          =   3300
      Left            =   120
      TabIndex        =   0
      Top             =   360
      Width           =   3855
   End
   Begin MSWinsockLib.Winsock wsk
      Index           =   0
      Left            =   4560
      Top             =   3600
      _ExtentX        =   741
      _ExtentY        =   741
      _Version        =   393216
   End
   Begin VB.Label lMinConnect
      AutoSize        =   -1  'True
      Caption         =   "活动连接: 0"
      Height          =   180
      Left            =   5715
      TabIndex        =   14
      Top             =   1150
      Width           =   990
   End
   Begin VB.Label lMaxConnect
      AutoSize        =   -1  'True
      Caption         =   "最大连接: 0"
      Height          =   180
      Left            =   4080
      TabIndex        =   13
      Top             =   1150
      Width           =   1335
   End
   Begin VB.Label lSet
      Caption         =   "连接超时设置:"
      Height          =   180
      Index           =   0
      Left            =   4080
      TabIndex        =   11
      Top             =   750
      Width           =   1170
   End
   Begin VB.Label lSet
      AutoSize        =   -1  'True
      Caption         =   "秒"
      Height          =   180
      Index           =   1
      Left            =   5685
      TabIndex        =   10
      Top             =   765
      Width           =   180
   End
   Begin VB.Label Label3
      Caption         =   "已收到的文件列表:"
      Height          =   180
      Index           =   2
      Left            =   120
      TabIndex        =   7
      Top             =   120
      Width           =   1530
   End
   Begin VB.Label lFolder
      Caption         =   "文件默认保存目录:"
      Height          =   180
      Left            =   4080
      TabIndex        =   6
      Top             =   1520
      Width           =   1770
   End
   Begin VB.Label lPort
      Caption         =   "端口号:"
      Height          =   255
      Left            =   5475
      TabIndex        =   5
      Top             =   390
      Width           =   735
   End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'自定义结构用来标识对应的WINSCOK控件的状态
Private Type UserType
    '是否处于文件传送中
    wskIsOnSend As Boolean
    '纪录打开的文件号
    wskSendFileNumber As Integer
    '纪录需要传送的文件大小
    wskSendFileSize As Long
    '目前接收的总字节数
    resevieBytes As Long
    '远程计算机的IP地址
    strIpAddress As String
    '接收的进度条窗体
    fm As frmIncept
    '接收的文件名
    strFileName As String
End Type
'这个数组是用来纪录连接进来的WINSOCK控件信息
Private userTypes() As UserType
'打开的文件号
Private hFile As Integer
'消息对话框
Private Declare Function MessageBox Lib "user32" Alias "MessageBoxA" (ByVal hWnd As Long, ByVal lpText As String, ByVal lpCaption As String, ByVal wType As Long) As Long
'调整LISTBOX水平滚动条的宽度的常数
Private Const LB_SETHORIZONTALEXTENT = &H194
'发送消息函数
Private Declare Function SendMessage Lib "user32" Alias "SendMessageW" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Any) As Long
'**********************************************************
'获取LISTBOX中最长字符串的宽度需要的结构和函数
Private Type RECT
    Left As Long
    Top As Long
    Right As Long
    Bottom As Long
End Type

Private Type POINTAPI
    y As Long
    x As Long
End Type
Private Declare Function DrawText Lib "user32" Alias "DrawTextA" (ByVal hdc As Long, ByVal lpStr As String, ByVal nCount As Long, lpRect As RECT, ByVal wFormat As Long) As Long
'**********************************************************
Private Declare Sub InitCommonControls Lib "comctl32.dll" ()

'不知道为什么一定得在UNLOAD事件或者在结束程序前运行一个中的到出函数才不会出错,不知道是不是微软的问题,我估计可能是资源文件的问题
Private Declare Function GetFileTitle Lib "comdlg32.dll" Alias "GetFileTitleA" (ByVal lpszFile As String, ByVal lpszTitle As String, ByVal cbBuf As Integer) As Integer

Private Sub Form_Initialize()
    InitCommonControls
End Sub

Private Sub cmdBrowse_Click()
    GetFolderPath textPath, Me.hWnd
End Sub

Private Sub cmdExit_Click()
    Unload Me
End Sub

Private Sub checkConnect_Click()
    If checkConnect.Value = 1 Then
        '默认存放目录是在根目录下的ReceiveFolder下其实你可以自己让用户选择存放目录就是在wsk_DataArrival事件中我注释掉的那部分
        If Trim(textPath.Text) = "" Then
            MessageBox 0, "请设置接收目录!!", "提示", vbInformation
            textPath.SetFocus
            Exit Sub
        Else
            '如果地址中的目录不存在则先创建之
            If Dir(textPath.Text, 1 Or 2 Or 4 Or vbDirectory) = "" Then MkDir textPath.Text
        End If
        wsk(0).LocalPort = CInt(Me.textPort)
        wsk(0).Listen
        timerStatus.Enabled = True
    Else
'        If IsAppIsOnRecevie Then
        '当关闭连接则把传送进度窗体关闭掉
        CloseSendWindow
        '不知道是VB问题还是什么当卸载窗体后又添加Forms.Count值没有变所以就用了上面的语句
''        On Error Resume Next
'        For i = 0 To Forms.Count - 1
'            If Forms(i).Name = "frmIncept" Then Unload Forms(i)
'        Next
        '向在线的WINSOCK连接发送退出消息
        SendMessageToIP
        '停止侦听
        wsk(0).Close
        '恢复数组为初始化状态
        Erase userTypes
    End If
End Sub

Private Sub cmdSet_Click()
    '更改实时检测WINSOCK控件状态的时间差
    timerStatus.Interval = Val(textMu.Text) * 1000
End Sub

Private Sub CloseSendWindow()
    Dim fm As Form
    For Each fm In Forms
        If fm.Name = "frmIncept" Then Unload fm
    Next
    Set fm = Nothing
End Sub

Private Sub Form_Load()
    '开始侦听5300端口
    wsk(0).LocalPort = 5300
    wsk(0).Listen
    '设置默认目录
    textPath.Text = App.Path & "/ReceiveFolder"
    '如果默认目录不存在则创建
    If Dir(App.Path & "/ReceiveFolder", 1 Or 2 Or 4 Or vbDirectory) = "" Then
        MkDir App.Path & "/ReceiveFolder"
    End If
End Sub

Private Sub Form_Unload(Cancel As Integer)
    If IsAppIsOnRecevie Then
        '这里必须用VB的MSGBOX(奇怪的是在编译器中可以阻止等恢复后继续,但是编译成EXE文件后阻止不了发送放继续)
        If MessageBox(0, "程序正在接收文件中,是否退出?", "提示", vbQuestion + vbYesNo) = vbYes Then
        'If MsgBox("程序正在接收文件中,是否退出?", vbQuestion + vbYesNo, "提示") = vbYes Then
            Dim i As Integer
            For i = 0 To wsk.Count - 1
                wsk(i).Close
            Next
            CloseSendWindow
'            If MsgBox("是否访问作者论坛??", vbQuestion + vbYesNo, "提示") = vbYes Then Call ShowOemHttp
            Unload Me
        Else
            Cancel = 1
            Exit Sub
        End If
    End If
    If MsgBox("是否访问作者论坛??", vbQuestion + vbYesNo, "提示") = vbYes Then Call ShowOemHttp
    Call GetFileTitle(vbNullString, vbNullString, 0)
End Sub

Private Sub ShowOemHttp()
    Shell "Explorer.exe /s,http://www.chenhui530.com"
End Sub

Private Sub textPort_Change()
    '当端口号更改后马上断开连接
    Me.checkConnect.Value = 0
End Sub

'实时检测WINSOCK控件状态,其着用可以检测与传送放的实时状态并且重新初始化其对应的WINSOCK自定义结构
Private Sub timerStatus_Timer()
    Dim i As Integer, n As Integer, intIndex As Integer
    Static maxConnect As Integer
    If wsk.UBound = 0 Then Exit Sub
    On Error Resume Next
    For i = 0 To wsk.UBound
        If wsk(i).State = sckError Or wsk(i).State = sckClosing Or wsk(i).State = sckClosed Then
            intIndex = GetUserTypeIndex(wsk(i).RemoteHostIP)
            If intIndex <> -1 Then
                If userTypes(intIndex).wskIsOnSend Then
                    CloseSendWindow
                    Close #userTypes(intIndex).wskSendFileNumber
                    MessageBox 0, "对方取消了文件的传输", "提示", vbInformation
                End If
                userTypes(intIndex).resevieBytes = 0
                userTypes(intIndex).wskIsOnSend = False
                userTypes(intIndex).wskSendFileNumber = -1
                userTypes(intIndex).wskSendFileSize = -1
                userTypes(intIndex).strIpAddress = ""
                userTypes(intIndex).strFileName = ""
            End If
            wsk(i).Close
            Unload wsk(i)
        Else
           n = n + 1
        End If
    Next

    lMinConnect.Caption = "活动连接: " & CStr(n - 1) '活动连接
    lMaxConnect.Caption = "最大连接: " & CStr(UBound(userTypes))
End Sub

Private Sub wsk_ConnectionRequest(Index As Integer, ByVal requestID As Long)
    If Index = 0 Then
        '第一次连接
        If Not IsArrayArrayInitialize(userTypes) Then
            ReDim userTypes(0)
            userTypes(0).wskIsOnSend = False
            userTypes(0).wskSendFileNumber = -1
            userTypes(0).wskSendFileSize = -1
            Load wsk(1)
            wsk(1).LocalPort = 0
            wsk(1).Accept requestID
            userTypes(0).strIpAddress = wsk(1).RemoteHostIP
        Else
            '第二次连接以上
            ReDim Preserve userTypes(0 To UBound(userTypes) + 1)
            userTypes(UBound(userTypes)).wskIsOnSend = False
            userTypes(UBound(userTypes)).wskSendFileNumber = -1
            userTypes(UBound(userTypes)).wskSendFileSize = -1
            Load wsk(wsk.Count)
            wsk(wsk.Count - 1).LocalPort = 0
            wsk(wsk.Count - 1).Accept requestID
            userTypes(UBound(userTypes)).strIpAddress = wsk(wsk.Count - 1).RemoteHostIP
        End If
    End If
End Sub

Private Sub wsk_DataArrival(Index As Integer, ByVal bytesTotal As Long)
    Dim bytes() As Byte, strMessage As String, strArray() As String, strPath As String, intIndex As Integer
    '通过IP地址查找对应的WINSOCK对应的自定义结构索引
    intIndex = GetUserTypeIndex(wsk(Index).RemoteHostIP)
    If intIndex <> -1 Then
        '如果指定WINSOCK控件处于文件传输中则获取数据类型为字节数组
        If userTypes(intIndex).wskIsOnSend Then
            wsk(Index).GetData bytes, vbArray + vbByte
            '写入指定文件中
            Put #userTypes(intIndex).wskSendFileNumber, , bytes
            userTypes(intIndex).resevieBytes = userTypes(intIndex).resevieBytes + UBound(bytes) + 1
            '显示进度
            userTypes(intIndex).fm.proBar.Value = userTypes(intIndex).resevieBytes
'            userTypes(intIndex).fm.Refresh
            '当接收完毕则重新初始化指定自定义结构的数据
            If userTypes(intIndex).resevieBytes >= userTypes(intIndex).wskSendFileSize Then
                Close #userTypes(intIndex).wskSendFileNumber
                userTypes(intIndex).wskIsOnSend = False
                userTypes(intIndex).wskSendFileNumber = -1
                userTypes(intIndex).wskSendFileSize = -1
                userTypes(intIndex).resevieBytes = 0
                Unload userTypes(intIndex).fm
                Set userTypes(intIndex).fm = Nothing
                '显示消息框
                MessageBox 0, "IP地址为: " & userTypes(intIndex).strIpAddress & " 文件: """ & userTypes(intIndex).strFileName & """ 接收完毕!!", "提示", vbInformation
                If Right(textPath.Text, 1) <> "/" Then strPath = textPath.Text & "/"
                '将文件添加到文件列表中
                lstFiles.AddItem strPath & userTypes(intIndex).strFileName
                '使用SendMessage函数调整ListBox空间水平滚动条
                SendMessage lstFiles.hWnd, LB_SETHORIZONTALEXTENT, ListTextWidth(lstFiles, strPath & userTypes(intIndex).strFileName), ByVal 0&
                userTypes(intIndex).strFileName = ""
            End If
        Else
            wsk(Index).GetData strMessage, vbString
            strArray = Split(strMessage, "**^_^**")
            If strArray(0) = "SendFile" Then
                If MessageBox(0, "IP地址为: " & strArray(2) & " 要传送 """ & ParseFileName(strArray(1)) & """ 文件给你,是否接受?", "提示", vbQuestion + vbYesNo) = vbYes Then
                    Me.Refresh
                    userTypes(intIndex).strFileName = ParseFileName(strArray(1))
                    '这里大家可以自己选择,1个是自动以传过来的文件保存在默认目录中还是让用户自己选择,这里我选择的是自动保存在默认目录中
'                    strFile = ShowDialogFile(Me.hWnd, 0, "请输入需要保存的文件名...", "", "保存文件 (*.*)" & Chr(0) & "*.*", "", "")
'                    If strFile = "" Then
'                        wsk(Index).SendData "DisAgree"
'                    Else
                    '如果用户同意则发送同意消息给指定WINSOCK对象
                    If Right(textPath.Text, 1) <> "/" Then strPath = textPath.Text & "/"
                    wsk(Index).SendData "Agree"
                    '设置文件处于传输状态
                    userTypes(intIndex).wskIsOnSend = True
                    '纪录打开的文件好
                    userTypes(intIndex).wskSendFileNumber = FreeFile
                    '以二进制打开文件
                    Open strPath & ParseFileName(strArray(1)) For Binary As userTypes(intIndex).wskSendFileNumber
                    '纪录文件的长度
                    userTypes(intIndex).wskSendFileSize = strArray(3)
                    '给显示进度窗体初始化
                    Dim fm As New frmIncept
                    fm.lMsg.Caption = "正在接收IP地址为: " & userTypes(intIndex).strIpAddress & " 传送送的文件: """ & ParseFileName(strArray(1)) & """"
                    fm.proBar.Max = CLng(strArray(3))
                    Set userTypes(intIndex).fm = fm
                    userTypes(intIndex).fm.Show
'                    End If
                Else
                    '如果不同意发送相应消息
                    wsk(Index).SendData "DisAgree"
                End If
   
            End If
        End If
    End If
End Sub

'判断数组是否已经初始化了
Private Function IsArrayArrayInitialize(typeArray() As UserType) As Boolean
    Dim i As Long
    On Error GoTo errLine
    i = UBound(typeArray)
    IsArrayArrayInitialize = True
    Exit Function
errLine:
    IsArrayArrayInitialize = False
End Function

'此函数从字符串中分离出文件名
Private Function ParseFileName(ByVal sFileIn As String) As String
    Dim i As Integer
    For i = Len(sFileIn) To 1 Step -1
        If InStr("/", Mid$(sFileIn, i, 1)) Then Exit For
    Next
    ParseFileName = Mid$(sFileIn, i + 1, Len(sFileIn) - i)
End Function

'通过IP地址获取指定WINSOCK对应的指定结构成员的索引
Private Function GetUserTypeIndex(ByVal strIpAddress As String) As Integer
    Dim i As Integer
    GetUserTypeIndex = -1
    If IsArrayArrayInitialize(userTypes) Then
        For i = 0 To UBound(userTypes)
            If userTypes(i).strIpAddress = strIpAddress Then
                GetUserTypeIndex = i
                Exit Function
            End If
        Next
    End If
End Function

'判断是否在接收文件
Private Function IsAppIsOnRecevie() As Boolean
    Dim i As Integer
    If IsArrayArrayInitialize(userTypes) Then
        For i = 0 To UBound(userTypes)
            If userTypes(i).wskIsOnSend Then
                IsAppIsOnRecevie = True
                Exit Function
            End If
        Next
    End If
End Function

'发送断开连接消息
Private Sub SendMessageToIP()
    Dim wskClient As Winsock
    For Each wskClient In wsk
        If wskClient.Index <> 0 Then
            wskClient.SendData "ShutConnect"
        End If
    Next
'    Dim i As Integer
'    If wsk.Count > 0 Then
'        For i = 1 To wsk.Count - 1
'            wsk(i).SendData "ShutConnect"
'        Next
'    End If
End Sub

'Private Function RemoveUserTypeBy()
'
'End Function
'获取LISTBOX的宽度
Private Function ListTextWidth(lstThis As ListBox, ByVal strMessage As String) As Long
    If lstThis.ListCount = 1 Then
        If strMessage <> "" Then
            If frmMain.ScaleX(lstThis.Width, vbTwips, vbPixels) < frmMain.ScaleX(frmMain.TextWidth(strMessage), vbTwips, vbPixels) Then
                ListTextWidth = frmMain.ScaleX(frmMain.TextWidth(strMessage), vbTwips, vbPixels) + 6
                Exit Function
            End If
        Else
            ListTextWidth = frmMain.ScaleX(lstThis.Width, vbTwips, vbPixels)
        End If
    End If
    Dim i As Long
    Dim tR As RECT
    Dim lW As Long
    Dim lWidth As Long
    Dim lHDC As Long

    With lstThis.Parent.Font
        .Name = lstThis.Font.Name
        .Size = lstThis.Font.Size
        .Bold = lstThis.Font.Bold
        .Italic = lstThis.Font.Italic
    End With
   
    lHDC = lstThis.Parent.hdc
   
    '便历所有的列表项以找到最长的项
    For i = 0 To lstThis.ListCount - 1
        DrawText lHDC, lstThis.List(i), -1, tR, &H400
        lW = tR.Right - tR.Left + 8
        If (lW > lWidth) Then
            lWidth = lW
        End If
    Next i
       
    '返回最长列表项的长度(像素)
    ListTextWidth = lWidth
End Function

 Attribute VB_Name = "modBrowsePath"
Option Explicit

Private Const BIF_RETURNONLYFSDIRS = 1

Private Const BIF_DONTGOBELOWDOMAIN = 2

Private Const OFN_HIDEREADONLY = &H4

Private Const OFN_PATHMUSTEXIST = &H800

Private Const OFN_FILEMUSTEXIST = &H1000

Private Const OFN_OVERWRITEPROMPT = &H2

Private Declare Function GetOpenFileName Lib "comdlg32.dll" Alias "GetOpenFileNameA" (pOpenfilename As OPENFILENAME) As Long

Private Declare Function GetSaveFileName Lib "comdlg32.dll" Alias "GetSaveFileNameA" (pOpenfilename As OPENFILENAME) As Long

Private Type OPENFILENAME
    lStructSize As Long
    hWnd As Long
    hInstance As Long
    lpstrFilter As String
    lpstrCustomFilter As String
    nMaxCustFilter As Long
    nFilterIndex As Long
    lpstrFile As String
    nMaxFile As Long
    lpstrFileTitle As String
    nMaxFileTitle As Long
    lpstrInitialDir As String
    lpstrTitle As String
    Flags As Long
    nFileOffset As Integer
    nFileExtension As Integer
    lpstrDefExt As String
    lCustData As Long
    lpfnHook As Long
    lpTemplateName As String
End Type

Private Declare Function SHBrowseForFolder Lib "shell32" (lpbi As BrowseInfo) As Long

Private Declare Function SHGetPathFromIDList Lib "shell32" (ByVal pidList As Long, ByVal lpBuffer As String) As Long

Private Declare Function lstrcat Lib "kernel32" Alias "lstrcatA" (ByVal lpString1 As String, ByVal lpString2 As String) As Long

Private Type BrowseInfo
    hWndOwner As Long
    pIDLRoot As Long
    pszDisplayName As Long
    lpszTitle As Long
    ulFlags  As Long
    lpfnCallback   As Long
    lParam   As Long
    iImage   As Long
End Type

'调用GetOpenFileName/GetSaveFileName函数打开浏览话框,当wMode值为1是打开浏览对话框当为其他值是保存文件对话框
Public Function ShowDialogFile(hWnd As Long, wMode As Integer, szDialogTitle As String, szFilename As String, szFilter As String, szDefDir As String, szDefExt As String) As String
    Dim x As Long, OFN As OPENFILENAME, szFile As String, szFileTitle As String
   
    OFN.lStructSize = Len(OFN)
    OFN.hWnd = hWnd
    OFN.lpstrTitle = szDialogTitle
    OFN.lpstrFile = szFilename & String$(250 - Len(szFilename), 0)
    OFN.nMaxFile = 255
    OFN.lpstrFileTitle = String$(255, 0)
    OFN.nMaxFileTitle = 255
    OFN.lpstrFilter = szFilter
    OFN.nFilterIndex = 1
    OFN.lpstrInitialDir = szDefDir
    OFN.lpstrDefExt = szDefExt

    If wMode = 1 Then
        OFN.Flags = OFN_HIDEREADONLY Or OFN_PATHMUSTEXIST Or OFN_FILEMUSTEXIST
        x = GetOpenFileName(OFN)
    Else
        OFN.Flags = OFN_HIDEREADONLY Or OFN_OVERWRITEPROMPT Or OFN_PATHMUSTEXIST
        x = GetSaveFileName(OFN)
    End If
   
    If x <> 0 Then
        If InStr(OFN.lpstrFile, Chr$(0)) > 0 Then
            szFile = Left$(OFN.lpstrFile, InStr(OFN.lpstrFile, Chr$(0)) - 1)
        End If
        ShowDialogFile = szFile
    Else
        ShowDialogFile = ""
    End If
   
End Function


'打开浏览目录对话框
Public Function GetFolderPath(ByVal Obj As TextBox, ByVal hWnd As Long)
    Dim lpIDList As Long
    Dim sBuffer As String
    Dim szTitle As String
    Dim tBrowseInfo As BrowseInfo

    szTitle = "请源路径:"
    With tBrowseInfo
        .hWndOwner = hWnd
        .lpszTitle = lstrcat(szTitle, "")
        .ulFlags = BIF_RETURNONLYFSDIRS + BIF_DONTGOBELOWDOMAIN
    End With

    lpIDList = SHBrowseForFolder(tBrowseInfo)

    If (lpIDList) Then
        sBuffer = Space(256)
        SHGetPathFromIDList lpIDList, sBuffer
        sBuffer = Left(sBuffer, InStr(sBuffer, vbNullChar) - 1)
        If Len(sBuffer) > 0 Then Obj.Text = sBuffer
    End If
End Function

0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:326378次
    • 积分:4456
    • 等级:
    • 排名:第6975名
    • 原创:81篇
    • 转载:0篇
    • 译文:2篇
    • 评论:431条
    文章分类
    最新评论
    chenhui530新浪博客