[C#] 
protected void button1_Click(object sender, System.EventArgs e)
{
    Stream myStream;
    OpenFileDialog openFileDialog1 = new OpenFileDialog();    openFileDialog1.InitialDirectory = "c:\\" ;
    openFileDialog1.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*" ;
    openFileDialog1.FilterIndex = 2 ;
    openFileDialog1.RestoreDirectory = true ;    if(openFileDialog1.ShowDialog() == DialogResult.OK)
    {
        if((myStream = openFileDialog1.OpenFile())!= null)
        {
            // Insert code to read the stream here.
            myStream.Close();
        }
    }
}

解决方案 »

  1.   

    不需要显示文件,只要文件夹就行了,详情请见winamp的添加->目录
      

  2.   

    openFileDialog1.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*" ;改成不存在的文件扩展名就可以了。
      

  3.   

    使用FolderBrowserDialog,.net Framework1.1中新增的类: 按钮处理函数用来打开一个路径选择框,private void buttonFolder_Click(object sender, System.EventArgs e){     FolderBrowserDialog myDialog = new  FolderBrowserDialog();     myDialog.ShowNewFolderButton = false;     myDialog.Description = "选择需要处理的解决方案或项目目录";     if(myDialog.ShowDialog()==DialogResult.OK)         this.textBoxFolder.Text = myDialog.SelectedPath;     myDialog.Dispose();}
    具体使用可以看这篇文章
    http://dev.csdn.net/develop/article/29/29248.shtm