C
Chris
Hi,
I need to manage 5 different ftp-connections, each with a specific
timer, but generally doing all the same kind of work (connect, put,
quit,..)
instead of writing 5 times te same kind of code like
ftpclient ftpclient1 = new ftpclient();
ftpclient ftpclient2 = new ftpclient();
....
ftpclient1.TimerInterval = 60; //seconds
ftpclient2.TimerInterval = 150; //seconds
void ftpclient1.connect()
{//connect to client1 using class ftpclient1};
void ftpclient2.connect()
{//connect to client2 using class ftpclient2};
....
The question now is whether I could put all of this into an array(?)
so that I only need to define the methods only once? I suppose I would
get something like
ftpclient[] myclients = new ftpclient[5];
void myclients[client1].TimerInterval = 60;
void myclients[client2].TimerInterval = 150;
void myclients [client1].connect()
{//connect to client1}
Is this possible? Or is there a better way? All hints/tips
appreaciated. Thanks!
Chris
I need to manage 5 different ftp-connections, each with a specific
timer, but generally doing all the same kind of work (connect, put,
quit,..)
instead of writing 5 times te same kind of code like
ftpclient ftpclient1 = new ftpclient();
ftpclient ftpclient2 = new ftpclient();
....
ftpclient1.TimerInterval = 60; //seconds
ftpclient2.TimerInterval = 150; //seconds
void ftpclient1.connect()
{//connect to client1 using class ftpclient1};
void ftpclient2.connect()
{//connect to client2 using class ftpclient2};
....
The question now is whether I could put all of this into an array(?)
so that I only need to define the methods only once? I suppose I would
get something like
ftpclient[] myclients = new ftpclient[5];
void myclients[client1].TimerInterval = 60;
void myclients[client2].TimerInterval = 150;
void myclients [client1].connect()
{//connect to client1}
Is this possible? Or is there a better way? All hints/tips
appreaciated. Thanks!
Chris