473,387 Members | 1,515 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Unknown error....

ljh
Here is the code section I am getting an error on

------------------------------------------
'create a watcher for each file type and hook it to the event subs
Dim i As Integer
For i = 0 To UBound(FileTypes) 'FileTypes is a string array with
stuff like "*.doc" in the arrays
ReDim Preserve Watchers(i)
Watchers(i) = New FileSystemWatcher
With Watchers(i)
.Filter = FileTypes(i).ToString
.EnableRaisingEvents = True
.IncludeSubdirectories = True
.InternalBufferSize = 1277592
.NotifyFilter = IO.NotifyFilters.DirectoryName Or
IO.NotifyFilters.LastWrite Or IO.NotifyFilters.FileName Or
IO.NotifyFilters.Size Or IO.NotifyFilters.Attributes

'add handlers
AddHandler Watchers(i).Changed, AddressOf watch_changed
AddHandler Watchers(i).Created, AddressOf watch_changed
AddHandler Watchers(i).Deleted, AddressOf watch_changed
AddHandler Watchers(i).Renamed, AddressOf watch_renamed
End With
Next
------------------------------------------

The error that I get is "The path is not of a legal form." and it points to
the ".EnableRaisingEvents = True" line of code.

The online help is generic and of no use at all.

I don't get it. There is no "path" here. EnableRaisingEvents does not
require a "path" argument only a boolean.

Without this line, no events are triggered and the code is useless.

Can somebody help me figure this one out? PLEEEEEEASE?
Jun 18 '06 #1
4 1019
Why do you post VB code in the C# newsgroup? Only post in the relevant
groups, "pleeeeeeeeeeeeeeeeeeeeeeease".

It's much more likely that you are actually getting the error on the
previous line, because you have something in the array that can't be
interpreted as a file mask.
ljh wrote:
Here is the code section I am getting an error on

------------------------------------------
'create a watcher for each file type and hook it to the event subs
Dim i As Integer
For i = 0 To UBound(FileTypes) 'FileTypes is a string array with
stuff like "*.doc" in the arrays
ReDim Preserve Watchers(i)
Watchers(i) = New FileSystemWatcher
With Watchers(i)
.Filter = FileTypes(i).ToString
.EnableRaisingEvents = True
.IncludeSubdirectories = True
.InternalBufferSize = 1277592
.NotifyFilter = IO.NotifyFilters.DirectoryName Or
IO.NotifyFilters.LastWrite Or IO.NotifyFilters.FileName Or
IO.NotifyFilters.Size Or IO.NotifyFilters.Attributes

'add handlers
AddHandler Watchers(i).Changed, AddressOf watch_changed
AddHandler Watchers(i).Created, AddressOf watch_changed
AddHandler Watchers(i).Deleted, AddressOf watch_changed
AddHandler Watchers(i).Renamed, AddressOf watch_renamed
End With
Next
------------------------------------------

The error that I get is "The path is not of a legal form." and it points to
the ".EnableRaisingEvents = True" line of code.

The online help is generic and of no use at all.

I don't get it. There is no "path" here. EnableRaisingEvents does not
require a "path" argument only a boolean.

Without this line, no events are triggered and the code is useless.

Can somebody help me figure this one out? PLEEEEEEASE?

Jun 18 '06 #2
ljh

"Göran Andersson" <gu***@guffa.com> wrote in message
news:u3**************@TK2MSFTNGP02.phx.gbl...
Why do you post VB code in the C# newsgroup? Only post in the relevant
groups, "pleeeeeeeeeeeeeeeeeeeeeeease".

It's much more likely that you are actually getting the error on the
previous line, because you have something in the array that can't be
interpreted as a file mask.
You are right. I had entered ".doc" instead of "*.doc".

And I will try and watch where I post more closely.

Thanks!


ljh wrote:
Here is the code section I am getting an error on

------------------------------------------
'create a watcher for each file type and hook it to the event subs
Dim i As Integer
For i = 0 To UBound(FileTypes) 'FileTypes is a string array
with stuff like "*.doc" in the arrays
ReDim Preserve Watchers(i)
Watchers(i) = New FileSystemWatcher
With Watchers(i)
.Filter = FileTypes(i).ToString
.EnableRaisingEvents = True
.IncludeSubdirectories = True
.InternalBufferSize = 1277592
.NotifyFilter = IO.NotifyFilters.DirectoryName Or
IO.NotifyFilters.LastWrite Or IO.NotifyFilters.FileName Or
IO.NotifyFilters.Size Or IO.NotifyFilters.Attributes

'add handlers
AddHandler Watchers(i).Changed, AddressOf watch_changed
AddHandler Watchers(i).Created, AddressOf watch_changed
AddHandler Watchers(i).Deleted, AddressOf watch_changed
AddHandler Watchers(i).Renamed, AddressOf watch_renamed
End With
Next
------------------------------------------

The error that I get is "The path is not of a legal form." and it points
to the ".EnableRaisingEvents = True" line of code.

The online help is generic and of no use at all.

I don't get it. There is no "path" here. EnableRaisingEvents does not
require a "path" argument only a boolean.

Without this line, no events are triggered and the code is useless.

Can somebody help me figure this one out? PLEEEEEEASE?

Jun 18 '06 #3
ljh
I spoke too soon.

The error is still there (even with my fix of ".doc" to "*.doc" for the
filter).

"ljh" <Re***@groups.please> wrote in message
news:aW******************@bignews3.bellsouth.net.. .

"Göran Andersson" <gu***@guffa.com> wrote in message
news:u3**************@TK2MSFTNGP02.phx.gbl...
Why do you post VB code in the C# newsgroup? Only post in the relevant
groups, "pleeeeeeeeeeeeeeeeeeeeeeease".

It's much more likely that you are actually getting the error on the
previous line, because you have something in the array that can't be
interpreted as a file mask.


You are right. I had entered ".doc" instead of "*.doc".

And I will try and watch where I post more closely.

Thanks!


ljh wrote:
Here is the code section I am getting an error on

------------------------------------------
'create a watcher for each file type and hook it to the event subs
Dim i As Integer
For i = 0 To UBound(FileTypes) 'FileTypes is a string array
with stuff like "*.doc" in the arrays
ReDim Preserve Watchers(i)
Watchers(i) = New FileSystemWatcher
With Watchers(i)
.Filter = FileTypes(i).ToString
.EnableRaisingEvents = True
.IncludeSubdirectories = True
.InternalBufferSize = 1277592
.NotifyFilter = IO.NotifyFilters.DirectoryName Or
IO.NotifyFilters.LastWrite Or IO.NotifyFilters.FileName Or
IO.NotifyFilters.Size Or IO.NotifyFilters.Attributes

'add handlers
AddHandler Watchers(i).Changed, AddressOf watch_changed
AddHandler Watchers(i).Created, AddressOf watch_changed
AddHandler Watchers(i).Deleted, AddressOf watch_changed
AddHandler Watchers(i).Renamed, AddressOf watch_renamed
End With
Next
------------------------------------------

The error that I get is "The path is not of a legal form." and it points
to the ".EnableRaisingEvents = True" line of code.

The online help is generic and of no use at all.

I don't get it. There is no "path" here. EnableRaisingEvents does not
require a "path" argument only a boolean.

Without this line, no events are triggered and the code is useless.

Can somebody help me figure this one out? PLEEEEEEASE?


Jun 18 '06 #4
ljh
I falsely thought that FileSystemWatcher would raise events for the whole
SYSTEM (hence the name, right?).

This is not the case.

You must provide a FileSystemWatcher.Path to watch for. This also means
that you must create a File"System"Watcher component for every drive
(physical drives and all networked drives) that you wish to monitor.
"ljh" <Re***@groups.please> wrote in message
news:sZ******************@bignews3.bellsouth.net.. .
I spoke too soon.

The error is still there (even with my fix of ".doc" to "*.doc" for the
filter).

"ljh" <Re***@groups.please> wrote in message
news:aW******************@bignews3.bellsouth.net.. .

"Göran Andersson" <gu***@guffa.com> wrote in message
news:u3**************@TK2MSFTNGP02.phx.gbl...
Why do you post VB code in the C# newsgroup? Only post in the relevant
groups, "pleeeeeeeeeeeeeeeeeeeeeeease".

It's much more likely that you are actually getting the error on the
previous line, because you have something in the array that can't be
interpreted as a file mask.


You are right. I had entered ".doc" instead of "*.doc".

And I will try and watch where I post more closely.

Thanks!


ljh wrote:
Here is the code section I am getting an error on

------------------------------------------
'create a watcher for each file type and hook it to the event subs
Dim i As Integer
For i = 0 To UBound(FileTypes) 'FileTypes is a string array
with stuff like "*.doc" in the arrays
ReDim Preserve Watchers(i)
Watchers(i) = New FileSystemWatcher
With Watchers(i)
.Filter = FileTypes(i).ToString
.EnableRaisingEvents = True
.IncludeSubdirectories = True
.InternalBufferSize = 1277592
.NotifyFilter = IO.NotifyFilters.DirectoryName Or
IO.NotifyFilters.LastWrite Or IO.NotifyFilters.FileName Or
IO.NotifyFilters.Size Or IO.NotifyFilters.Attributes

'add handlers
AddHandler Watchers(i).Changed, AddressOf watch_changed
AddHandler Watchers(i).Created, AddressOf watch_changed
AddHandler Watchers(i).Deleted, AddressOf watch_changed
AddHandler Watchers(i).Renamed, AddressOf watch_renamed
End With
Next
------------------------------------------

The error that I get is "The path is not of a legal form." and it
points to the ".EnableRaisingEvents = True" line of code.

The online help is generic and of no use at all.

I don't get it. There is no "path" here. EnableRaisingEvents does not
require a "path" argument only a boolean.

Without this line, no events are triggered and the code is useless.

Can somebody help me figure this one out? PLEEEEEEASE?




Jun 18 '06 #5

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

Similar topics

0
by: Eugen Walcher | last post by:
Hello All, I'm getting this error in my error_log in apache. Can anyone offer any assistance in fixing the problem? I'm using RH 9 with apache 2.0.53 and PHP v4.3.11
0
by: Robert | last post by:
did you solve this problem? It seems to be still present here with py2.3.5. Robert -- From: Manish Jethani <manish.j@gmx.net> User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US;...
5
by: Lars-Erik Aabech | last post by:
Hi! Guess it's my day again.. Tried to deploy a test release of a new asp.net web today, and got a terrible error. The web is running swell on three development computers, but when it's copied...
1
by: TARUN | last post by:
Hello All, I am facing problem regarding Atlas. I have install the AtlasSetup.msi in my .NET framework 2.0, and i open the new Atlas Website...... Let me first explain the my senario, I...
7
by: John | last post by:
Hi Everyone, I'm having this extremely annoying problem with Internet Explorer 6, giving me an error message saying "unknown runtime error" whenever I try to alter the contents of a <divelement...
1
by: tactech | last post by:
Hello Can somebody help me and tell me why I can’t change the background color of the second PN2 panel. I get this error about unknown source Exception in thread "AWT-EventQueue-1"...
1
by: Valli | last post by:
Hi, I have an issue with the content page('default.aspx') while executing the asp.net project. I am getting the error 1. unknown server tag 'asp.Scriptmanager' 2. unknown server tag...
3
by: Sa¹a Bistroviæ | last post by:
Sa¹a Bistroviæ Antuna Mihanviæa 13 40000 Èakovec Croatia sasa.bistrovic@ck.t-com.hr FPC: Exception : Unknown Run-Time error : 210 Hi, I'm Sa¹a from Croatia.
2
by: Calvin Cheng | last post by:
Hi, I am attempting to convert a bunch of .txt files into html using the docutils package. It works for most of the txt files except for the index.txt file which gives 2 errors: (1)...
1
by: Gramma2005 | last post by:
I am trying to connect to an access db through php on Windows Server 2003 running XAMPP. The code I am using has worked before on another access db on this server so I am not sure what is causing...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.