|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Ftp file managementHi,
I have a ftp file that changes every 2 minutes. I want to detect the file date/time change e read the information in it. The ftp adress has logis/password Can anyone help me ? tanks Jorge use a folder/file NOTIFY API, e.g.:
Private Const FILE_NOTIFY_CHANGE_ATTRIBUTES = &H4 Private Const FILE_NOTIFY_CHANGE_DIR_NAME = &H2 Private Const FILE_NOTIFY_CHANGE_FILE_NAME = &H1 Private Const FILE_NOTIFY_CHANGE_SIZE = &H8 Private Const FILE_NOTIFY_CHANGE_LAST_WRITE = &H10 Private Const FILE_NOTIFY_CHANGE_SECURITY = &H100 Private Const FILE_NOTIFY_CHANGE_ALL = &H4 Or &H2 Or &H1 Or &H8 Or &H10 Or &H100 Private Declare Function FindFirstChangeNotification Lib "kernel32" Alias "FindFirstChangeNotificationA" (ByVal lpPathName As String, ByVal bWatchSubtree As Long, ByVal dwNotifyFilter As Long) As Long Private Declare Function FindCloseChangeNotification Lib "kernel32" (ByVal hChangeHandle As Long) As Long Private Declare Function FindNextChangeNotification Lib "kernel32" (ByVal hChangeHandle As Long) As Long Private Declare Function WaitForSingleObject Lib "kernel32" (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long Private Declare Function ResetEvent Lib "kernel32" (ByVal hEvent As Long) As Long Private Sub Form_Load() 'KPD-Team 2000 'URL: http://www.allapi.net/ 'E-Mail: KPDT***@Allapi.net Dim Ret As Long 'Set the notification hook Ret = FindFirstChangeNotification("C:\", &HFFFFFFFF, FILE_NOTIFY_CHANGE_ALL) 'Wait until the event is triggered WaitForSingleObject Ret, &HFFFFFFFF MsgBox "Event Triggered for the first time" 'Reactivate our hook FindNextChangeNotification Ret 'Wait until the event is triggered WaitForSingleObject Ret, &HFFFFFFFF MsgBox "Event Triggered for the second time" 'Remove our hook FindCloseChangeNotification Ret End Sub <jorgemiguel.paul***@gmail.com> schreef in bericht Show quoteHide quote news:1129041290.996384.178090@o13g2000cwo.googlegroups.com... > Hi, > > I have a ftp file that changes every 2 minutes. I want to detect the > file date/time change e read the information in it. The ftp adress has > logis/password > > Can anyone help me ? > > tanks > Jorge > <jorgemiguel.paul***@gmail.com> wrote in message
news:1129041290.996384.178090@o13g2000cwo.googlegroups.com... Is the physical folder where the FTP'd file actually lives on your network? > I have a ftp file that changes every 2 minutes. I want to detect the > file date/time change e read the information in it. The ftp adress has > logis/password > > Can anyone help me ? If so, use what Martin gave you. If not, then you'd probably have to use WinInet API calls to poll the FTP site and check the attributes of the file.
Other interesting topics
|
|||||||||||||||||||||||