ITPUB??ì3
12月微软Hyper-V虚拟化沙龙主题征集

新一届的微软MVP评选已经开始,欢迎各位推荐!

标题: .net
离线 lchflower
一般会员



精华贴数 0
个人空间 0
技术积分 186 (10161)
社区积分 0 (117875)
注册日期 2004-6-2
论坛徽章:0
      
      

发表于 2004-7-12 17:45 
.net

datagrid数据
private 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 ;
openFileDialog1.Multiselect=false;
if(openFileDialog1.ShowDialog() == DialogResult.OK)
{
if((myStream = openFileDialog1.OpenFile())!= null)
{
fileNames=openFileDialog1.FileName;// Insert code to read the stream here.
                    //MessageBox.Show(fileNames);
myStream.Close();
}
            //dataGrid1.DataSource=fileNames;
try
{
Binding bind=new Binding("Text",typeof(string),fileNames);  
dataGrid1.DataBindings.Add(bind);
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
可是总是显示:
我得代码就着两行,可是显示说:
无法创建字段“选择目录文件”的子列表


只看该作者    顶部
离线 omencathay
菜田守望者


精华贴数 7
个人空间 80
技术积分 5173 (268)
社区积分 7016 (222)
注册日期 2002-10-21
论坛徽章:7
现任管理团队成员     
      

发表于 2004-7-12 21:43 
你的用户在那个目录下有没有创建目录文件的权限?
再看一下aspnet用户的权限


只看该作者    顶部
 
    

相关内容


CopyRight 1999-2006 itpub.net All Right Reserved.
北京皓辰广域网络信息技术有限公司. 版权所有
E-mail:Webmaster@itpub.net
京ICP证:010037号 联系我们 法律顾问