Ejemplo n.º 1
0
        private void OpenSite(string[] data)
        {
            string saveFile = "OpenSite_" + data[2];

            using (WebClient client = new WebClient()) // WebClient class inherits IDisposable
            {
                client.DownloadFile(data[1], saveFile);
            }
            _service.UploadFile(data[2], saveFile, GetContetTypeForCommand(data[0]));
        }
Ejemplo n.º 2
0
        private async void OnFileCreated(object sender, FileSystemEventArgs e)
        {
            _logger.LogDebug($"File created. {e}");
            var uploaded = await _driveService.UploadFile(e.FullPath);

            if (uploaded.Id != null)
            {
                if (File.Exists(e.FullPath))
                {
                    File.Delete(e.FullPath);
                }
            }
        }