投稿日 | : 2006/02/14(Tue) 12:06 |
投稿者 | : アキラ |
Eメール | : |
URL | : |
タイトル | : INETを使用したPUTについて |
どなたか助けてください。
現在、INETコントロールを使用したWinPC→WinPCへのアップロード(PUT)を
作成しているのですが、処理が全て完了した後(End Subも抜けた後)に
3〜4秒ほど何かを考え込んでいるようで、プロジェクトの解放が遅いんです。
アップロードは正常にできています。
どうすればよいかアドバイスを頂けませんでしょうか?
環境:WinXP-SP2、VB6.0-SP5
---<ソース>----------------------------------------
Option Explicit
Public gstrflg As String
Private Sub Form_Activate()
Dim strwork As String
gstrflg = "0"
With Inet
.URL = "xxx.xxx.xxx.xxx"
.UserName = "administrator"
.Password = "admin"
.Protocol = icFTP
.RequestTimeout = "10"
strwork = "PUT C:\tmp\test.txt temp\test123.txt"
'接続&転送
.Execute , strwork
'PUT処理が終わるまで待機
Do While gstrflg = "0"
DoEvents
Loop
If gstrflg = "1" Then
MsgBox ("エラー発生")
Else
MsgBox ("正常終了")
End If
gstrflg = "0"
'切断
.Execute , "CLOSE"
Do While gstrflg = "0"
DoEvents
Loop
If gstrflg = "3" Then
MsgBox ("CLOSE-OK")
Else
MsgBox ("???")
End If
gstrflg = "0"
'切断
.Execute , "QUIT"
Do While gstrflg = "0"
DoEvents
Loop
If gstrflg = "3" Then
MsgBox ("QUIT-OK")
Else
MsgBox ("???")
End If
.Cancel
End With
Unload Me
End Sub
Private Sub Inet_StateChanged(ByVal State As Integer)
If State = icError Then
gstrflg = "1"
ElseIf State = icResponseCompleted Then
gstrflg = "2"
ElseIf State = icDisconnected Then
gstrflg = "3"
End If
End Sub
---<ソース>----------------------------------------