private void button1_Click(object sender, EventArgs e) { DownloadServiceClient client = new DownloadServiceClient(); MyFile file = client.Download(); System.IO.File.WriteAllBytes(@"C:\PGM\Executables\" + file.Name, file.content); MessageBox.Show(file.Name + " downloaded"); }
private void buttonDownloadFile_Click(object sender, EventArgs e) { DownloadServiceClient client = new DownloadServiceClient(); File file = client.DownloadDocument(); System.IO.File.WriteAllBytes(@"C:\RESTnSOAP\" + file.Name, file.Content); MessageBox.Show($"{file.Name} is downloaded"); }
private void btnDownload_Click(object sender, EventArgs e) { lblProgress.Visible = true; lblProgress.Text = "Fetching Files..."; client = new DownloadServiceClient(context); client.DownloadDocument(); lblProgress.Text = "Download Complete"; }
private void Init() { Trace.TraceInformation($"Init: " + _url); var uri = new Uri(_url); HttpBindingBase binding = uri.Scheme == Uri.UriSchemeHttps ? new BasicHttpsBinding() { MaxReceivedMessageSize = 1073741824 } as HttpBindingBase : new BasicHttpBinding() { MaxReceivedMessageSize = 1073741824 }; using (var service = new DownloadServiceClient(binding, new EndpointAddress(uri))) { AllInfoObject = service.GetAllDownloadFileInfo(); InfoObject = service.GetLastDownloadFileInfo(); _init = true; } }