Option Explicit
Private m_ftpSite As String
Private m_userName As String
Private m_password As String
Private m_ip As String
Public Sub CheckIfConnected()
Call GetConstance
If InternetGetConnectedState(0, 0) Then
If CheckIp() <> GetIp() Then
Call FTPindexhtml
DoEvents
DoEvents
DoEvents
Call FTPindexhtml
DoEvents
DoEvents
DoEvents
Call SetIp
End If
Else
'****ty off line .. never really good to be off line
End If
End Sub
Public Sub FTPindexhtml()
ServiceMain.Inet1.URL = m_ftpSite
ServiceMain.Inet1.UserName = m_userName
ServiceMain.Inet1.Password = m_password
ServiceMain.Inet1.Protocol = icFTP
'Inet1.Execute , "put " & App.Path & "\index.html /index.html"
ServiceMain.Inet1.Execute , "put " & "c:\index.html /index.html"
Do While ServiceMain.Inet1.StillExecuting
DoEvents
Loop
End Sub
Public Sub GetConstance()
'Open App.Path & "\ftp.txt" For Input As #1 ' Open file for input.
Open "c:" & "\ftp.txt" For Input As #1 ' Open file for input.
Do While Not EOF(1)
Input #1, m_ftpSite, m_userName, m_password, m_ip
Loop
Close #1
End Sub