[Windows Mobile Development and Hacking General] lukesmith:
Im using the project from OpenNETCF.org to check when a new image is created in \\My Documents\\My Pictures by the camera. I have the following code (add a listBox and button to your form)

namespace OpenNETCFApplication1

{

using System;

using System.Drawing;

using System.Collections;

using System.Windows.Forms;

using System.Data;

using OpenNETCF;

using OpenNETCF.Drawing;

using OpenNETCF.Windows.Forms;

using OpenNETCF.IO;

/// <summary>

/// Summary description for Form1.

/// </summary>

public class Form1 : System.Windows.Forms.Form

{

private System.Windows.Forms.Button button1;

private System.Windows.Forms.ListBox listBox1;

private System.Windows.Forms.MainMenu mainMenu1;

public Form1()

{

//

// Required for Windows Form Designer support

//

InitializeComponent();

//

// TODO: Add any constructor code after InitializeComponent call

//

}

/// <summary>

/// Clean up any resources being used.

/// </summary>

protected override void Dispose( bool disposing )

{

base.Dispose( disposing );

}

#region Windows Form Designer generated code

/// <summary>

/// Required method for Designer support - do not modify

/// the contents of this method with the code editor.

/// </summary>

private void InitializeComponent()

{

this.mainMenu1 = new System.Windows.Forms.MainMenu();

this.button1 = new System.Windows.Forms.Button();

this.listBox1 = new System.Windows.Forms.ListBox();

//

// button1

//

this.button1.Location = new System.Drawing.Point(88, 32);

this.button1.Text = "button1";

this.button1.Click += new System.EventHandler(this.button1_Click);

//

// listBox1

//

this.listBox1.Location = new System.Drawing.Point(72, 88);

this.listBox1.Size = new System.Drawing.Size(100, 93);

//

// Form1

//

this.Controls.Add(this.listBox1);

this.Controls.Add(this.button1);

this.Menu = this.mainMenu1;

this.Text = "Form1";

}

#endregion

/// <summary>

/// The main entry point for the application.

/// </summary>

static void Main()

{

ApplicationEx.Run(new Form1());

}

FileSystemWatcher myWatcher = new FileSystemWatcher("\\My Documents\\My Pictures");

private void button1_Click(object sender, System.EventArgs e)

{

myWatcher.Filter = "*.jpg";

myWatcher.Created+=new FileSystemEventHandler(myWatcher_Created);

myWatcher.Changed+=new FileSystemEventHandler(myWatcher_Changed);

myWatcher.Deleted+=new FileSystemEventHandler(myWatcher_Deleted);

myWatcher.Renamed+=new RenamedEventHandler(myWatcher_Renamed);

myWatcher.EnableRaisingEvents = true;

}

private void myWatcher_Created(object sender, FileSystemEventArgs e)

{

listBox1.Items.Add(String.Format("File system event: File {0} {1}",

e.FullPath, e.ChangeType));

}

private void myWatcher_Changed(object sender, FileSystemEventArgs e)

{

/* listBox1.Items.Add(String.Format("File system event: File {0} {1}",

e.FullPath, e.ChangeType)); */

}

private void myWatcher_Deleted(object sender, FileSystemEventArgs e)

{

/* listBox1.Items.Add(String.Format("File system event: File {0} {1}",

e.FullPath, e.ChangeType)); */

}

private void myWatcher_Renamed(object sender, RenamedEventArgs e)

{

/* listBox1.Items.Add(String.Format("File system event: File {0} {1}",

e.FullPath, e.ChangeType)); */

}

}

}

the problem is the created event is never fired, and only fires when a new folder is created. Can anyone help?