Thursday, March 22, 2012

Thread Issue

I have a method that serves the purpose of FTPing a file. I intend to call that method by a thread. The method I intend to call takes FileSystemEventargs e as a parameter. Please tell me how to do that.

Regards,

Sandeep Kumar

hi,

you could use some similar code:

//// invoke the method using thread//Thread ftpThread =new Thread(new ParameterizedThreadStart(TransferFile));FileSystemEventargs args =new FileSystemEventargs();ftpThread.Start(args);//// this is your method that will be invoked//public static void TransferFile(object fArgs){ FileSystemEventargs args = fArgsas FileSystemEventargs;// // do sth here //}

Cheers,

Yani

0 comments:

Post a Comment