- OpenFileDialog dlg = new OpenFileDialog();
- dlg.Title = "选择要转换的图片";
- dlg.Filter = "Image files (*.jpg;*.bmp;*.gif;*.png)|*.jpg;*.jpeg;*.gif;*.bmp;*.png|AllFiles (*.*)|*.*";
- if (DialogResult.OK == dlg.ShowDialog())
- {
- ImgToBase64String(dlg.FileName);
- }
转载于:https://blog.51cto.com/497017/1093376