Click here to Skip to main content
15,920,111 members
Home / Discussions / C#
   

C#

 
Generalrestore problem for mdi child form [modified] Pin
Miss Maheshwari19-Feb-08 19:42
Miss Maheshwari19-Feb-08 19:42 
QuestionHow to use LinkLabel? Pin
Chaitanya Joshi19-Feb-08 19:42
Chaitanya Joshi19-Feb-08 19:42 
GeneralRe: How to use LinkLabel? Pin
Arjun Marwaha19-Feb-08 20:35
Arjun Marwaha19-Feb-08 20:35 
GeneralRe: How to use LinkLabel? Pin
Chaitanya Joshi21-Feb-08 3:20
Chaitanya Joshi21-Feb-08 3:20 
GeneralRe: How to use LinkLabel? Pin
N a v a n e e t h19-Feb-08 20:36
N a v a n e e t h19-Feb-08 20:36 
Questionregarding port monitoring Pin
routhu rao19-Feb-08 19:23
routhu rao19-Feb-08 19:23 
Questionretrieving text from richtextbox [modified] Pin
DKalepu19-Feb-08 19:14
DKalepu19-Feb-08 19:14 
Questionhow to pass parameters to webclient.uploadFileAsyncEventHandler() Pin
anumadhu19-Feb-08 18:46
anumadhu19-Feb-08 18:46 
Hello everyone,

I am developing a module in C#.net3.0 on windows XP. I am downloading a file from the ftp server in asynchronous mode. Before the download completes, i am doing another Async download of another file by again creating the object of WebClient with the same name.

I am handling the downloadFileCompleteEventHandler(Object sender, AsyncEventHandler e). Now i want to see which file download has raised this event handler. For this, i think i have to send file name as parameter to this downloadFileCompleteEventHandler(Object sender, AsyncEventHandler e) method.

My code snippet is as follows:


private void FtpToStagingServer(String spotID, Int32 Ctr)
{
//DOWNLOADING TO LOCAL DATABASE SERVER

WebClient ccftp = new WebClient();
try
{
//Download from Clearcut Server
ccftp.Credentials = new NetworkCredential(Username, Password);
Uri CcFtp = new Uri("ftp://"+HostIp+"/Assets/"+spotID+".mpg");

ccftp.DownloadFileCompleted += new System.ComponentModel.AsyncCompletedEventHandler(ccftp_DownloadFileCompleted);
ccftp.DownloadFileAsync(CcFtp, "C:\\AWS_FilesDownloaded\\"+spotID+".mpg");
tAssetId = spotID;
}
catch (WebException wes)
{
}
catch (Exception es)
{
}

// throw new Exception("The method or operation is not implemented.");
}

void ccftp_DownloadFileCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e)
{
//Transfer the downloaded asset from Clearcut server to the Staging server/
MessageBox.Show(" Ftp from clearcut to local drive completed");
WebClient ssFtp = new WebClient();
try
{
ssFtp.Credentials = new NetworkCredential("abc", "abc123");
ssFtp.UploadFileCompleted += new UploadFileCompletedEventHandler(ssFtp_UploadFileCompleted);
ssFtp.UploadFileAsync(new Uri("ftp://somehostIpwith path/"+ tAssetId+".mpg"), "C:\\AWS_cc_download\\" + tAssetId + ".mpg");
}
catch (WebException wes)
{
}
catch (Exception es)
{
}
//throw new Exception("The method or operation is not implemented.");
}


I am trying it by taking a temporary global variable to hold the filname, but it is of no use.

Could you please help me in this.. by giving required c#.net links or sample code.

Thank you

Anee
QuestionHow to do Ftp from one server to another server directly Pin
anumadhu19-Feb-08 18:22
anumadhu19-Feb-08 18:22 
QuestionHow to print image or text from the memory in win application?? Pin
Tridip Bhattacharjee19-Feb-08 18:17
professionalTridip Bhattacharjee19-Feb-08 18:17 
AnswerRe: How to print image or text from the memory in win application?? Pin
Arjun Marwaha19-Feb-08 19:58
Arjun Marwaha19-Feb-08 19:58 
Questionhow to Save SDI form's outer look as a file in file system in my win application?? Pin
Tridip Bhattacharjee19-Feb-08 18:14
professionalTridip Bhattacharjee19-Feb-08 18:14 
GeneralSave Text as Image Pin
D i x y19-Feb-08 17:19
D i x y19-Feb-08 17:19 
GeneralRe: Save Text as Image Pin
CKnig19-Feb-08 18:12
CKnig19-Feb-08 18:12 
GeneralRe: Save Text as Image Pin
D i x y19-Feb-08 18:44
D i x y19-Feb-08 18:44 
Generalreferencing dlls with same name. Pin
D2raghu19-Feb-08 17:08
D2raghu19-Feb-08 17:08 
GeneralRe: referencing dlls with same name. Pin
Hamza Nadim20-Feb-08 5:00
Hamza Nadim20-Feb-08 5:00 
GeneralGAC related question Pin
Imtiaz Murtaza19-Feb-08 13:24
Imtiaz Murtaza19-Feb-08 13:24 
GeneralRe: GAC related question Pin
Luc Pattyn19-Feb-08 13:56
sitebuilderLuc Pattyn19-Feb-08 13:56 
GeneralRe: GAC related question Pin
PIEBALDconsult19-Feb-08 14:04
mvePIEBALDconsult19-Feb-08 14:04 
QuestionThread instance object location Pin
Spacix One19-Feb-08 13:01
Spacix One19-Feb-08 13:01 
GeneralRe: Thread instance object location Pin
Luc Pattyn19-Feb-08 14:25
sitebuilderLuc Pattyn19-Feb-08 14:25 
GeneralRe: Thread instance object location Pin
Spacix One19-Feb-08 17:08
Spacix One19-Feb-08 17:08 
GeneralRe: Thread instance object location Pin
Luc Pattyn20-Feb-08 4:07
sitebuilderLuc Pattyn20-Feb-08 4:07 
GeneralReflectively setting properties on value types Pin
Skippums19-Feb-08 12:06
Skippums19-Feb-08 12:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.