用Socket问题。请大家帮帮忙,再线等
Private Sub MnuFtpProperty_Click()
Dim nCHMODint As Integer, ntFile As Integer, nCHMODBool As Boolean, DoCHMODFileBool As Boolean, DoCHMODCount As Boolean
Dim CommandFindFile As String, nCHMODFtpExplore As String, nCHMODBoolCount As Boolean
frmCHMOD.Show 1
If runCHMOD = False Then Exit Sub
On Error Resume Next
'
Set FindFtpFile = Nothing
Set FindFtpDirectory = Nothing
CloseFindFtpDirectory = True
With ListFtpFile
'
If .SelectedItem Is Nothing Then Exit Sub
'
nCHMODFtpExplore = ComboFtpExplore.SelectedItem
'
For nCHMODint = 1 To .ListItems.Count
If .ListItems(nCHMODint).SubItems(2) = "文件夹" And .ListItems(nCHMODint).Selected Then
FindFtpDirectory.Add nCHMODFtpExplore & .ListItems(nCHMODint) & "/"
End If
'
If Not (.ListItems(nCHMODint).SmallIcon = 1) And .ListItems(nCHMODint).Selected Then
FindFtpFile.Add .ListItems(nCHMODint)
End If
Next nCHMODint
'
If DirectoryCHMOD = True Or NotFileCHMOD = True Then
Call CHMODFileDirectory
'
Dim nNoFileCHMOD As String, nCHMODSting As Variant, NoCHMODint As Integer, nNoCHMODBool As Boolean
'
DoCHMODCount = True
'
m_objFtpClient.UpConnection = False
'
Do While DoCHMODCount
'
ntFile = ntFile + 1
'
GetCurrentText = FindFtpDirectory.Item(ntFile)
'
If GetCurrentText = "/" Then
GetCurrentText = "/"
Else
GetCurrentText = Left(GetCurrentText, Len(GetCurrentText) - 1)
End If
'
If Not InStr(GetCurrentText, "\") = 0 Then
GetCurrentText = Replace$(GetCurrentText, "\", "/")
End If
'
nCHMODint = True: DoFindBool = False
'
.ListItems.Clear
'
'm_objFtpClient.CurrentDirectoryFiles.
'
'
GetCurrentDirectoryText = 2
'
m_objFtpClient.SetCurrentDirectory GetCurrentText
'
Do While m_objFtpClient.UpConnection
If m_objFtpClient.UpConnection Then
m_objFtpClient.UpConnection = False
End If
DoEvents
Loop
'
If CloseFindFtpDirectory = False Then
'CloseFindFtpDirectory = True
Exit Sub
End If
'
For nCHMODint = 1 To .ListItems.Count
nCHMODBool = True: nNoCHMODBool = True
'
CommandFindFile = .ListItems(nCHMODint)
'
If .ListItems(nCHMODint).SubItems(2) = "文件夹" Then
'FindFtpDirectory.Add nFindFtpExplore & nCHMODBool.ListItems(nCHMODint)
'CommandFindFile = nFindFtpExplore & nCHMODBool.ListItems(nCHMODint)
FindFtpDirectory.Add GetCurrentText & CommandFindFile & "/"
End If
'
If NotFileCHMOD Then
nNoFileCHMOD = ReadINI("CHMOD", "NoFileCHMOD", nMainFileName)
nCHMODSting = Split(nNoFileCHMOD, Chr(1))
For NoCHMODint = LBound(nCHMODSting) To UBound(nCHMODSting)
If Not InStr(nCHMODSting(NoCHMODint), "*") = 0 Then
nCHMODSting(NoCHMODint) = Right(nCHMODSting(NoCHMODint), Len(nCHMODSting(NoCHMODint)) - 1)
End If
If Not InStr(CommandFindFile, nCHMODSting(NoCHMODint)) = 0 Then
nNoCHMODBool = False
'
Exit For
End If
Next NoCHMODint
Else
nNoCHMODBool = True
End If
'
If Not (.ListItems(nCHMODint).SmallIcon = 1) And nNoCHMODBool Then
Do While nCHMODBool
'
If m_objFtpClient.FindFile Then
'
If CloseFindFtpDirectory = False Then
'CloseFindFtpDirectory = True
Exit Sub
End If
'
m_objFtpClient.SiteCHMODSend SiteCHMOD & " " & CommandFindFile
'
m_objFtpClient.FindFile = False: m_objFtpClient.UpConnection = False: nCHMODBool = False
'
End If
DoEvents
Loop
End If
'
Next nCHMODint
'
If ntFile = FindFtpDirectory.Count Then
'
DoCHMODCount = False
'
GetCurrentText = FindFtpDirectory.Item(1)
'
If GetCurrentText = "/" Then
GetCurrentText = "/"
Else
GetCurrentText = Left(GetCurrentText, Len(GetCurrentText) - 1)
GetCurrentText = Left(GetCurrentText, InStrRev(GetCurrentText, "/") - 1)
End If
'
If Not InStr(GetCurrentText, "\") = 0 Then
GetCurrentText = Replace$(GetCurrentText, "\", "/")
End If
'
GetCurrentDirectoryText = 2
'
m_objFtpClient.SetCurrentDirectory GetCurrentText
Set FindFtpDirectory = Nothing
'
Exit Sub
End If
DoEvents
Loop
Else
Call CHMODFileDirectory
RefreshCurrentDirectory
End If
End With
End Sub