private void LoadImage() { try { string filter = "Image(*.jpg;*.png;*.bmp;*.tiff;*.jepg;*.gif;)|*.jpg;*.png;*.bmp;*.tiff;*.jepg;*.gif|" + "jpg(*.jpg)|*.jpg|png(*.png)|*.png|bmp(*.bmp)|*.bmp"; FileContent fileContent = FileSelect.GetSelectFileContent(filter, "选择图片"); if (fileContent == null) { return; } if (string.IsNullOrEmpty(fileContent.FileName)) { return; } radLabel1.Text = fileContent.FileName.Split('.')[1]; pictureBox1.Image = Image.FromFile(fileContent.FileName); OpenFileImage(fileContent.FileName); } catch (System.Exception ex) { MessageBox.Show(ex.Message); } }
private void Menu_addFile_Click(object sender, EventArgs e) { FileContent fileContent = FileSelect.GetSelectFileContent("(*.*)|*.*", "选择文件"); sourchFilePath = fileContent.FileName; }
private void Menu_importFromFile_Click(object sender, EventArgs e) { var fileObject = FileSelect.GetSelectFileContent("(*.*)|*.*", "导入文件"); }