hi everyone.. i am using windows application to get data from web service and according to the result an action will be taken
for example if the result is 1 i will download a file and the name of the file will be taken from my database.
all that i need is to pass the name of the file from the form to the button_click Event
my result is:
private void button1_Click(object sender, EventArgs e)
{
WebClient webClient = new WebClient();
webClient.DownloadFileCompleted += new AsyncCompletedEventHandler(Completed);
webClient.DownloadProgressChanged += new DownloadProgressChangedEventHandler(ProgressChanged);
webClient.DownloadFileAsync(new Uri("http://www.myexample.com/john_test/Setup.msi"), @"c:\Setup.msi");
}
i want it to be
private void button1_Click(object sender, EventArgs e)
{
WebClient webClient = new WebClient();
webClient.DownloadFileCompleted += new AsyncCompletedEventHandler(Completed);
webClient.DownloadProgressChanged += new DownloadProgressChangedEventHandler(ProgressChanged);
webClient.DownloadFileAsync(new Uri("http://www.myexample.com/john_test/"[b]+Result[/b]), @"c:\"[b]+Result[/b]);
}
i want to pass variable to the button or use something like Global variable but i dont know how to use its syntax?
can anyone help me please