views:

43

answers:

1

Hi

I have C# windows mobile program.

if the user pull out the PPC in the middle of transfer file from PC to PPC

How I can catch this error ?

thank's

+2  A: 

This is how I do it: Testing for and Responding to Network Connections in the .NET Compact Framework.

Using the class presented in that article is as easy as:

        // Create the network connected watcher
        _network = new Network(false, 5);
        _network.NetworkConnected += OnConnectedEventHandler;
        _network.EnableRaisingEvents = true;

The other option is to use the OpenNETCF Smart Device Framework's OpenNETCF.WindowsCE.DeviceManagement class

Mitch Wheat