private async void AddFileButton_Click(object sender, EventArgs e) { try { var openFileDialog = new OpenFileDialog(); if (openFileDialog.ShowDialog() == DialogResult.OK) { var filePath = openFileDialog.FileName; await fileSharingClient.SendFile(filePath, FileSharingServerUrl); } } catch (Exception ex) { MessageBox.Show("Исключение: " + ex.Message); } }
private async void btLoadFile_Click(object sender, EventArgs e) { try { OpenFileDialog openFileDialog = new OpenFileDialog(); if (openFileDialog.ShowDialog() == DialogResult.OK) { string filePath = openFileDialog.FileName; await fileSharingClient.SendFile(filePath, FileSharingServerUrl); //UpdateAttachedFiles(fileSharingClient.filesToSend); } } catch (Exception ex) { MessageBox.Show("Exception: " + ex.Message); } }