Home All Groups Group Topic Archive Search About
Author
18 May 2009 7:05 PM
Paulo
Hi, on the ListBox I added the FileName + Date/Hour of the file. If the
directory (Dir_Change) changes, the listbox is repopulated.
But if the user modifies the file on other program, I'd like to repopulate
(refresh) the listbox with the new file Date/Hour...

Do you know if it's possible to be done ?

Thanks
Using VB6

Author
18 May 2009 7:21 PM
Brian
Use a timer to periodically scan the folder to see if the last modified date
has chanced and update the listbox item.  You would have to read this
attribute at the start and persist it in an associated array.

Show quoteHide quote
"Paulo" wrote:

> Hi, on the ListBox I added the FileName + Date/Hour of the file. If the
> directory (Dir_Change) changes, the listbox is repopulated.
> But if the user modifies the file on other program, I'd like to repopulate
> (refresh) the listbox with the new file Date/Hour...
>
> Do you know if it's possible to be done ?
>
> Thanks
> Using VB6
>
>
>
Author
18 May 2009 7:31 PM
Brian
A good sample program to read the file times can be found here.

http://www.thescarms.com/vbasic/filetime.aspx



Show quoteHide quote
"Brian" wrote:

> Use a timer to periodically scan the folder to see if the last modified date
> has chanced and update the listbox item.  You would have to read this
> attribute at the start and persist it in an associated array.
>
> "Paulo" wrote:
>
> > Hi, on the ListBox I added the FileName + Date/Hour of the file. If the
> > directory (Dir_Change) changes, the listbox is repopulated.
> > But if the user modifies the file on other program, I'd like to repopulate
> > (refresh) the listbox with the new file Date/Hour...
> >
> > Do you know if it's possible to be done ?
> >
> > Thanks
> > Using VB6
> >
> >
> >
Author
18 May 2009 7:44 PM
Nobody
"Paulo" <eris_pa***@terra.com.br> wrote in message
news:u0LGFu%231JHA.2656@TK2MSFTNGP05.phx.gbl...
> Hi, on the ListBox I added the FileName + Date/Hour of the file. If the
> directory (Dir_Change) changes, the listbox is repopulated.
> But if the user modifies the file on other program, I'd like to repopulate
> (refresh) the listbox with the new file Date/Hour...
>
> Do you know if it's possible to be done ?

Beside what Brian suggested, check this VB6 sample:

http://vbnet.mvps.org/code/fileapi/watchedfolder.htm