I'm having trouble with getting a program to work.
I have a list of PC's that I want to copy a file to.
I want to loop through the list of PC names and copy the file over.
I want to do this asynchronously.
Then I want to write to the screen once each is completed.
I have managed to get it to copy the files asynchronously but I don't understand how to get the response back.
Can any help please!Code:public delegate void StartCopy(string pcName); public void CopyFiles() { SqlDataReader PCList; PCList = SqlHelper.ExecuteReader(ConfigurationSettings.AppSettings["MyConnection"], "GetPCList"); while(PCList.Read()) { StartCopy thePC = new StartCopy(DoTheCopy); IAsyncResult PCResult = thePC.BeginInvoke(PCList["PCName"].ToString(), null, null); } } private void DoTheCopy(string pcName) { /* code to copy the file in here */ }




Reply With Quote