473,799 Members | 3,245 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

directory watcher ?

..2003 have a filesystemwatch er ...

does it have a directorysystem watcher ? What i need is to watch whether
directory is deleted ?

i assume filesystemwatch er delete method is for file, not directory.

Pls advise
Nov 21 '05 #1
3 3002
Hi,

The filesystemwatch will watch directories.

http://msdn.microsoft.com/library/de...classtopic.asp

Ken
------------------
"James" <jk****@hotmail .com> wrote in message
news:OT******** ******@TK2MSFTN GP15.phx.gbl...
.2003 have a filesystemwatch er ...

does it have a directorysystem watcher ? What i need is to watch whether
directory is deleted ?

i assume filesystemwatch er delete method is for file, not directory.

Pls advise

Nov 21 '05 #2
does it watch a directory being DELETED ?

i thot filewatch only watch FILES within subdirectory.

More concern is DIRECTORY itself being deleted.

"Ken Tucker [MVP]" <vb***@bellsout h.net> wrote in message
news:OB******** ******@TK2MSFTN GP09.phx.gbl...
Hi,

The filesystemwatch will watch directories.

http://msdn.microsoft.com/library/de...classtopic.asp
Ken
------------------
"James" <jk****@hotmail .com> wrote in message
news:OT******** ******@TK2MSFTN GP15.phx.gbl...
.2003 have a filesystemwatch er ...

does it have a directorysystem watcher ? What i need is to watch whether
directory is deleted ?

i assume filesystemwatch er delete method is for file, not directory.

Pls advise


Nov 21 '05 #3
Hi,

Watch the directories parent for the directory being delete.
Simple example needs 2 buttons (btnDelete and btnAdd), a filesystemwatch er,
and listbox.

Imports System.IO
Public Class Form1
Inherits System.Windows. Forms.Form

#Region " Windows Form Designer generated code "
Private Sub Form1_Load(ByVa l sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load
Directory.Creat eDirectory("C:\ Watch me")
FileSystemWatch er1.Path = "C:\Watch me"
FileSystemWatch er1.IncludeSubd irectories = True

End Sub

Private Sub FileSystemWatch er1_Created(ByV al sender As Object, ByVal e
As System.IO.FileS ystemEventArgs) Handles FileSystemWatch er1.Created
Dim strOut As String

strOut = String.Format(" Created {0}", e.Name)
ListBox1.Items. Add(strOut)
End Sub

Private Sub btnAdd_Click(By Val sender As System.Object, ByVal e As
System.EventArg s) Handles btnAdd.Click
Try
Directory.Creat eDirectory("C:\ Watch me\Delete me")
Catch ex As Exception

End Try
End Sub

Private Sub btnDelete_Click (ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles btnDelete.Click
Try
Directory.Delet e("C:\Watch me\Delete me")
Catch ex As Exception

End Try
End Sub

Private Sub FileSystemWatch er1_Deleted(ByV al sender As Object, ByVal e
As System.IO.FileS ystemEventArgs) Handles FileSystemWatch er1.Deleted
Dim strOut As String

strOut = String.Format(" Deleted {0}", e.Name)
ListBox1.Items. Add(strOut)

End Sub
End Class
Ken
--------------------
"James" <jk****@hotmail .com> wrote in message
news:uD******** ******@TK2MSFTN GP14.phx.gbl...
does it watch a directory being DELETED ?

i thot filewatch only watch FILES within subdirectory.

More concern is DIRECTORY itself being deleted.

"Ken Tucker [MVP]" <vb***@bellsout h.net> wrote in message
news:OB******** ******@TK2MSFTN GP09.phx.gbl...
Hi,

The filesystemwatch will watch directories.

http://msdn.microsoft.com/library/de...classtopic.asp

Ken
------------------
"James" <jk****@hotmail .com> wrote in message
news:OT******** ******@TK2MSFTN GP15.phx.gbl...
> .2003 have a filesystemwatch er ...
>
> does it have a directorysystem watcher ? What i need is to watch whether
> directory is deleted ?
>
> i assume filesystemwatch er delete method is for file, not directory.
>
> Pls advise
>
>



Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2130
by: yasir | last post by:
I am using Watcher to detect any file renamed event. From time to time, or when lot of files gets renamed at the same time, Watcher fails to detect some files. I have set the InternalBuffereSize to 64 (i think it is 64MB, please correct me if i am wrong). I move the indication file to another folder once the processing is completed. I am thinking to take care of this problem by checking if the processes has actually was done on this file...
2
1778
by: Marcelo López | last post by:
Hi all. I'm developing a Windows Explorer like app. I have my own repository to store the files and a bd where i keep the path to each file. I have to watch the repository all time to avoid modifications by other people. So that, i'm using a win service in wich i implement a file watcher. I have two basic questions:
0
1250
by: JIM.H. | last post by:
Hello, I am calling this sub to start watcher. It seems if the network drive went down and came back, watcher is not checking the file anymore. What is the secure way to stop it and call this sub to start it again. Thanks, Jim. Private Sub WatchFileSystem(ByVal fPath As String, ByVal fName As String)
1
1092
by: Iris | last post by:
I have a directory which I want to be watched by the file- watcher. Now I have a question. I want this directory to be selected once and then be safed so that everytime I start the program I dont have to load it again. So that it is printed into the textbox and only changed if necessary. Can you help me??
4
1444
by: Marcelo López | last post by:
Hi all. I'm developing a Windows Explorer like app. I have my own repository to store the files and a bd where i keep the path to each file. I have to watch the repository all time to avoid modifications by other people. So that, i'm using a win service in wich i implement a file watcher. I have two basic questions:
1
1213
by: R.A. | last post by:
Hi I have a class which contains a datagrid and a file watcher object. When the file watcher event is triggered then in the event handler I add rows to the data grid. the problem is that every time I add rows to the datagrid from the file watcher event handler the program stops - there are no exceptions thrown the program just terminates. I have checked the datagrid without adding rows in the file watcher handler and there are no...
3
3764
by: Nick | last post by:
Is it possible to read a list of files from a specified directory using VB.net We have company intranet and I have created a page that displays photos from different events. I have coded a page that display images from a particular directory and named the files Pic1.jpg, Pic2.jpg etc. My code then cycles through the images and displays them in the browser. I store the current image number in a session variable and apply it to the image...
3
1502
by: Nathan Sokalski | last post by:
I have several pieces of data that I use the HttpApplicationState for, because they rarely change and are used by everyone. When these pieces of data are created, they are created either from several files that rarely change or are a list of the files in a directory that I rarely add or remove files from. Therefore, I want to be able to detect when a file is added to, removed from, or modified in one of these directories. Because I create...
1
2679
by: =?Utf-8?B?QXZp?= | last post by:
Hi I have an interesting issue, I hope someone can shead light on: I have a 2 server "web farm" with a web app that produces image files. To ensure synchronization of content on both machines, we have built a vb.net (2.0) file watcher service to keep the web folders synchronized between the 2 machines. the app uses in-proc session variables for some other stuff. We have run into a strange problem: when the file watcher service is
0
9687
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9541
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10228
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10027
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6805
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5463
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4141
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3759
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.