|
-
Dec 22nd, 2007, 09:08 PM
#1
Thread Starter
New Member
[2.0] Problem Capturing file creation in InternetCache folder
Hi all!
I'm having a problem with the filesystemwatcher to catch file creation in the InternetCache folder because the event 'Created' doesn't fire (Neither any of the other events)...
I've seen other ppl with the same problem but i can't find answers 
Here's my code:
Code:
private void frmMain_Load(object sender, EventArgs e)
{
fswInternetCache.Path = Environment.GetFolderPath(Environment.SpecialFolder.InternetCache).ToString();
fswInternetCache.NotifyFilter = System.IO.NotifyFilters.FileName;
fswInternetCache.Filter = "*.gif";
wb.Navigate("http://www.google.com/");
}
private void fswInternetCache_Created(object sender, System.IO.FileSystemEventArgs e)
{
MessageBox.Show(e.FullPath);
}
Any ideas?
Thanks in advance
Last edited by Tughack; Dec 23rd, 2007 at 07:51 AM.
-
Dec 23rd, 2007, 09:14 AM
#2
Thread Starter
New Member
Re: [2.0] Problem Capturing file creation in InternetCache folder
Hmm, it happened something weird. I created a WebBrowser control array, and it captured the files oO
When i only had a control, there was no response.
Both control array and single control, were handled the same way...
Anyone knows why?
EDIT: I'm also not capturing ALL the files, i assume they're created with very short time differences and for that reason the fsw doesnt fire on every file creation. How can i solve this?
EDIT2: Well, with some luck, i got it loading the picture i needed, so here's my code again:
Code:
private void fswInternetCache_Created(object sender, System.IO.FileSystemEventArgs e)
{
if (e.Name.IndexOf("mypic") > 0)
{
picb.Image = System.Drawing.Image.FromFile(e.FullPath);
MessageBox.Show("done!");
}
}
The problem is that SOMETIMES, it throws an OutOfMemory Exception when i try to load the picture into a picbox and it points to this:
Application.Run(new frmMain());
Someone?
Last edited by Tughack; Dec 23rd, 2007 at 01:58 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|