Jump to content

Monitoring file in VB.

- - - - -

  • Please log in to reply
5 replies to this topic

#1
xawier

xawier

    Newbie

  • Members
  • Pip
  • 3 posts
Hello, ;). Is it possible to VB monitor a file (for ex. testfile.txt) ? I wanna to write a code who monitor the testfile.txt and show me how it's change.

Edited by xawier, 28 December 2011 - 06:55 AM.


#2
Blimp

Blimp

    Programmer

  • Members
  • PipPipPipPip
  • 154 posts
We need a bit more help with what you want to monitor. Give us an idea...

#3
ash34

ash34

    Newbie

  • Members
  • PipPip
  • 12 posts
You could set up a scheduled task, write your code to keep track of the file, set up your scheduled task to run your executable every so often and monitor, notify as needed.

#4
logicPwn

logicPwn

    Learning Programmer

  • Members
  • PipPipPip
  • 91 posts

xawier said:

Hello, ;). Is it possible to VB monitor a file (for ex. testfile.txt) ? I wanna to write a code who monitor the testfile.txt and show me how it's change.

Yes it is possible.

FileSystemWatcher Class (System.IO)

Edited by logicPwn, 13 February 2012 - 03:57 PM.

"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live."
- Martin Golding

#5
Blimp

Blimp

    Programmer

  • Members
  • PipPipPipPip
  • 154 posts

logicPwn said:


Would be helpful if he asked what he wanted to monitor though! What if he wanted to monitor if the file was open, and how much memory the process was using?

#6
logicPwn

logicPwn

    Learning Programmer

  • Members
  • PipPipPip
  • 91 posts

Blimp said:

Would be helpful if he asked what he wanted to monitor though! What if he wanted to monitor if the file was open, and how much memory the process was using?

Learn to read? He asked to hook into events on when it changed so he could display difference.
"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live."
- Martin Golding




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users