private void butUp_Click(object sender, EventArgs e)
        {
            OpenFileDialog dlg=new OpenFileDialog();
            dlg.AddExtension=true;
            dlg.CheckFileExists=true;
            dlg.ShowDialog();
            
        }
  出来一个显示文件的对话框后,就没有反应了
  我想做一个文件上传的程序
  不知道还要加什么,请大家多多指教,在线等待

解决方案 »

  1.   

    string fname = string.Empty;if ( dlg.ShowDialog() == DialogResult.OK )
    {
        fname = odf.FileName;
    }
      

  2.   

    MSDN帮助
    private void button1_Click(object sender, System.EventArgs e)
    {
       if(openFileDialog1.ShowDialog() == DialogResult.OK)
       {
          System.IO.StreamReader sr = new 
             System.IO.StreamReader(openFileDialog1.FileName);
          MessageBox.Show(sr.ReadToEnd());
          sr.Close();
       }
    }