private void timerDownload_Tick(object sender, EventArgs e)
 {
     try
     {
         DateTime now = DateTime.Now;
         int      res = now.Minute % 5;
         //                if (now.Minute.ToString() == "30" || now.Minute.ToString() == "00")
         if (res.ToString() == "0")
         {
             try
             {
                 this.Cursor = Cursors.WaitCursor;
                 string fileLocation = string.Empty;
                 foreach (DataGridViewRow row in dataGridViewList.Rows)
                 {
                     DownloadFileDelegate newDD = DownloadFile;
                     fileLocation = Convert.ToString(row.Cells[0].Value);
                     DownloadFile(fileLocation);
                     IAsyncResult asyncResult    = newDD.BeginInvoke(fileLocation, null, null);
                     string       callBackResult = newDD.EndInvoke(asyncResult);
                 }
             }
             catch { }
         }
     }
     catch { }
 }
Beispiel #2
0
        public ThreeSharpFormSample()
        {
            InitializeComponent();

            this.transfers = new BindingList <TransferInfo>();
            this.dataGridViewStatistics.DataSource = transfers;

            bindStatisticsDelegate = new BindStatisticsDelegate(this.BindStatistics);
            listBucketDelegate     = new ListBucketDelegate(this.ListBucket);
            listFolderDelegate     = new ListFolderDelegate(this.ListFolder);
            uploadFileDelegate     = new UploadFileDelegate(this.UploadFile);
            downloadFileDelegate   = new DownloadFileDelegate(this.DownloadFile);

            this.basePath = "C:\\";

            config = new ThreeSharpConfig();
            config.AwsAccessKeyID     = Properties.Settings.Default.AwsAccessKeyID;
            config.AwsSecretAccessKey = Properties.Settings.Default.AwsSecretAccessKey;
            config.ConnectionLimit    = 40;
            config.IsSecure           = true;

            // It is necessary to use the SUBDOMAIN CallingFormat for accessing EU buckets
            config.Format = CallingFormat.SUBDOMAIN;

            this.service = new ThreeSharpQuery(config);
        }
        public ThreeSharpFormSample()
        {
            InitializeComponent();

            this.transfers = new BindingList<Transfer>();
            this.dataGridViewStatistics.DataSource = transfers;

            bindStatisticsDelegate = new BindStatisticsDelegate(this.BindStatistics);
            listBucketDelegate = new ListBucketDelegate(this.ListBucket);
            listFolderDelegate = new ListFolderDelegate(this.ListFolder);
            uploadFileDelegate = new UploadFileDelegate(this.UploadFile);
            downloadFileDelegate = new DownloadFileDelegate(this.DownloadFile);

            this.basePath = "C:\\";

            config = new ThreeSharpConfig();
            config.AwsAccessKeyID = Properties.Settings.Default.AwsAccessKeyID;
            config.AwsSecretAccessKey = Properties.Settings.Default.AwsSecretAccessKey;
            config.ConnectionLimit = 40;
            config.IsSecure = true;

            // It is necessary to use the SUBDOMAIN CallingFormat for accessing EU buckets
            config.Format = CallingFormat.SUBDOMAIN;

            this.service = new ThreeSharpQuery(config);
        }