用Socket问题。请大家帮帮忙,再线等

oicqpen 2005-05-01 12:32:51
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
...全文
99 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
oicqpen 2005-05-02
  • 打赏
  • 举报
回复
唆,每次都是我在说,
oicqpen 2005-05-02
  • 打赏
  • 举报
回复
是不是我用一个Winsock1向服务器发送长期的命令过去才使程序卡起来呢,

请高手帮帮小弟吧,那我问一个Winsock1登录FTP服务器时,我想用Winsock1(0)、Winsock1(1)、Winsock1(2)三个来完成任务要如何完成呢

我用Winsock1(0)登录FTP服务器怎么才能使我这两个也可以跟Winsock1(1)、Winsock1(2)服务器通信呢

小弟十分急,那晚我等了两点多,也没人回我,真的真的感谢你们帮帮小弟,,,,分不够可以再加,请帮帮小弟好不好高手们,问题解决马上加分
oicqpen 2005-05-01
  • 打赏
  • 举报
回复
我用以上的代码向服务器发送dele命令,循环文件夹等文件发送命令,但任务发送完成后,打开FTP服务器文件夹就变卡了,开始发送就不会卡,慢慢、慢慢就变卡了,为什么,重新运行程序就不会,

请大家帮帮小弟,感谢大家
oicqpen 2005-05-01
  • 打赏
  • 举报
回复
大家没有时间吗
oicqpen 2005-05-01
  • 打赏
  • 举报
回复



Private Sub CHMODFileDirectory()
Dim nCHMODint As Integer, nCHMODBool As Boolean, nNoCHMODBool As Boolean, CommandFindFile As String

m_objFtpClient.FindFile = True
With ListFtpFile
nCHMODint = 0
For nCHMODint = 1 To FindFtpFile.Count
nCHMODBool = True
'
CommandFindFile = FindFtpFile.Item(nCHMODint)

'
If NotFileCHMOD Then
Dim nNoFileCHMOD As String, nCHMODSting As Variant, NoCHMODint As Integer
'
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 CloseFindFtpDirectory = False Then
'CloseFindFtpDirectory = True
RefreshCurrentDirectory
Exit Sub
End If
'
If nNoCHMODBool Then
Do While nCHMODBool
If m_objFtpClient.FindFile Then
'
m_objFtpClient.SiteCHMODSend SiteCHMOD & " " & CommandFindFile
'
m_objFtpClient.FindFile = False: nCHMODBool = False
'
End If
'
DoEvents
Loop
End If
'
Next nCHMODint
m_objFtpClient.UpConnection = False
End With
End Sub

VBDN 2005-05-01
  • 打赏
  • 举报
回复
哎,同情,这么玩了还不睡!

7,763

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧