2013-02-16 2 views
0

이미지 경로를 얻어야 데이터베이스에 저장할 수 있습니다 ..이미지 경로 업로드

누군가 나를 도와 줄 수 있습니까? 여기

내 코드는 ...

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

메시지 상자 쇼 외국인 것들 .. 난 .. 선택된 이미지의 경로 표시하도록 MSGBOX을 필요

답변

0
if (openFileDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK) 
    { 
     MessageBox.Show((new System.IO.FileInfo(openFileDialog1.FileName)).DirectoryName + openFileDialog1.FileName); 
    } 
+0

완벽하게! btw, 경로 끝에 파일 이름을 어떻게 추가 할 수 있습니까? –

+0

답변을 업데이트했습니다. + openFileDialog1.FileName –