im doing an application in which im transfering file through FTP.i succesfully done all the things to transfer files and folders.now i want to know how to get an event whenever the the network cable is connected or disconnected while im transfering a file.
im using SYSTEM.NET NAMESPACE,FTPWEBREQUEST Class.
when will the event get raised i just run mi program and disconnected the network cable but nothing happens.
im not able to raise the event will u send ur code .actually it is working in vb.net.it doesnt get raised in c# below is mycode:
public partial class Form1 : Form
{
public static event NetworkAvailabilityChangedEventHandler networkchanged;
string file_to_upload;
string serverip;
string username;
string password;
FileStream fstream;
Stream strem;
public Form1()
{
InitializeComponent();
networkchanged += new NetworkAvailabilityChangedEventHandler(Form1_networkchanged);
}
void Form1_networkchanged(object sender, NetworkAvailabilityEventArgs e)
{
//my implementations goes here
//throw new Exception("The method or operation is not implemented.");
}
i done it this is very useful.thank you very much