解决方案 »
- mssql不支持datediff("ww", d1, d2, vbMonday)这样?
- ???急,求助,怎麼將 TTS 的語音庫打包在自己的程序裡?
- 为什么DataEnviront对象关闭之后,重新打开提示3709错误
- 小第跪求一问题~
- 如何用VB的API(IP H什么的)得到路由表等信息?不要用DOS命令输出拦截
- 各位大哥,小弟刚刚开始使用vb,这里有个问题想请教各位,很急很急
- 熟悉ACTIVE REPORT请进!
- 在windows中使用:查看-->详细资料 后出来的类似grid一样的东东是什么呀?
- 谁知道WIN2000 P的注册码?在线等待,只给第一个正确回答者加分!急!!(内空)
- 请问大家在表格里如何固定行头?多谢了
- 在MFC 规则Dll 中使用MsChart 怎么就不能正常显示了呢?
- 请教一下,用VB6.0如何编写HDLC脱帧
Object = "{48E59290-9880-11CF-9754-00AA00C00908}#1.0#0"; "MSINET.OCX"
Begin VB.Form Form1
BorderStyle = 1 'Fixed Single
ClientHeight = 3060
ClientLeft = 45
ClientTop = 330
ClientWidth = 4035
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3060
ScaleWidth = 4035
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command1
Caption = "下载"
Height = 495
Left = 1440
TabIndex = 0
Top = 1320
Width = 1215
End
Begin InetCtlsObjects.Inet Inet1
Left = -15
Top = -15
_ExtentX = 1005
_ExtentY = 1005
_Version = 393216
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim ExeStr As String
Dim Done As Boolean
Private Sub cmd(cmdstr As String)
Do
If Inet1.StillExecuting = False Then Exit Do
Loop
ExeStr = cmdstr
Done = False
Debug.Print ExeStr; "="
Inet1.Execute , ExeStr
Do
DoEvents
If Done Then Exit Do
Loop
End Sub
Public Sub ReadNewDat(dat As String)
Inet1.URL = "ftp://192.168.1.123"
Inet1.UserName = "username"
Inet1.Password = "password" 'cmd "PWD"
'cmd "CD /data"
'cmd "DIR" cmd "GET " + vox + ".dat " + App.Path + "\" + dat + ".dat" cmd "QUIT"
End SubPrivate Sub Command1_Click()
Command1.Enabled = False
ReadNewDat ("20111109")
Command1.Enabled = True
End SubPrivate Sub Inet1_StateChanged(ByVal State As Integer)
Dim intFile As Integer
Dim vtData() As Byte
Dim str As String
'On Error GoTo ISCerr
Debug.Print "State="; State,
Select Case State
Case 0
Debug.Print "icNone"
Case 1
Debug.Print "icHostResolvingHost"
Case 2
Debug.Print "icHostResolved"
Case 3
Debug.Print "icConnecting"
Case 4
Debug.Print "icConnected"
Case 5
Debug.Print "icRequesting"
Case 6
Debug.Print "icRequestSent"
Case 7
Debug.Print "icReceivingResponse"
Case 8
Debug.Print "icResponseReceived"
If Left(ExeStr, 2) = "CD" Then Done = True
Case 9
Debug.Print "icDisconnecting"
Case 10
Debug.Print "icDisconnected"
Done = True
Case 11
Debug.Print "icError of [" + ExeStr + "]="; Inet1.ResponseInfo
Done = True
Case 12
Debug.Print "icResponseCompleted----------------"
Do
str = Inet1.GetChunk(1024, icString)
If LenB(str) = 0 Then Exit Do
Debug.Print str
Loop
Done = True
End Select
Exit Sub
ISCerr:
Resume Next
End Sub
如果是同步则可以多次post,每次产生指定的结果.
但inet性能不太好。有时还卡住。建议是使用httpserver组件。在VB中引入它就可以了。它也类似inet但更安全可靠。且可以自己写类来控制它。很好用