OpenFileDialog  openFileDialog =  new  OpenFileDialog ( ) ; openFileDialog. Title =  "请选择要打开的文件" ; openFileDialog. Multiselect =  true ;   openFileDialog. InitialDirectory =  @"C:\Users\user1\Desktop\研发报告\basler拍照研究报告" ; openFileDialog. Filter =  "文本文件|*.pptx|图片文件|*.jpg|所有文件|*.*" ; openFileDialog. ShowDialog ( ) ; string =  openFileDialog. FileName; try { using  ( FileStream  fs =  new  FileStream ( path,  FileMode. Open,  FileAccess. Read) ) { byte [ ] =  new  byte [ fs. Length] ; int =  fs. Read ( buffer,  0 ,  buffer. Length) ; string =  Encoding. UTF8. GetString ( buffer,  0 ,  r) ; textBox1. Text =  str; } } catch  ( Exception ) { MessageBox. Show ( "未选中文件" ) ; } SaveFileDialog  saveFileDialog =  new  SaveFileDialog ( ) ; saveFileDialog. Title =  "请选择要保存的路径" ; saveFileDialog. InitialDirectory =  @"C:\Users\user1\Desktop\研发报告\basler拍照研究报告" ; saveFileDialog. Filter =  "文本文件|*.txt|所有文件|*.*" ; saveFileDialog. ShowDialog ( ) ; string =  saveFileDialog. FileName; if  ( path ==  "" ) { return ; } using  ( FileStream  fileStream =  new  FileStream ( path,  FileMode. OpenOrCreate,  FileAccess. Write) ) { byte [ ] =  Encoding. UTF8. GetBytes ( textBox1. Text) ; fileStream. Write ( vs,  0 ,  vs. Length) ; } MessageBox. Show ( "保存成功" ) ; 
   FontDialog  fontDialog =  new  FontDialog ( ) ; fontDialog. ShowDialog ( ) ; textBox2. Font =  fontDialog. Font; 
  ColorDialog  colorDialog =  new  ColorDialog ( ) ; colorDialog. ShowDialog ( ) ; textBox2. ForeColor=  colorDialog. Color;