Ejemplo n.º 1
0
        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");
        }
Ejemplo n.º 2
0
        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");
        }
Ejemplo n.º 3
0
 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";
 }
Ejemplo n.º 4
0
        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;
            }
        }