예제 #1
0
 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);
     }
 }
예제 #2
0
파일: ChatForm.cs 프로젝트: ilia844/KSiS
        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);
            }
        }