我的程序如下:
private void GetFoldersAndFiles(TreeNode tn)
{
string currentPath=tn.fullpath;
currentPath=currentPath.Remove(0,5); //设置当前文件夹
System.IO.DirectoryInfo folderInfo = new System.IO.DirectoryInfo (currentPath);
System.IO.DirectoryInfo[] folders;
try
{
//获取当前文件夹下的所有文件夹
folders = folderInfo.GetDirectories();
}
catch
{
return;
}
}
但是总是报错说:E:\c-exe\treeview\index.aspx.cs(56): “Microsoft.Web.UI.WebControls.TreeNode”并不包含对“fullpath”的定义
错误提示语句为:string currentPath=tn.fullpath;
这是怎么回事,我需要怎么做.谢谢!
private void GetFoldersAndFiles(TreeNode tn)
{
string currentPath=tn.fullpath;
currentPath=currentPath.Remove(0,5); //设置当前文件夹
System.IO.DirectoryInfo folderInfo = new System.IO.DirectoryInfo (currentPath);
System.IO.DirectoryInfo[] folders;
try
{
//获取当前文件夹下的所有文件夹
folders = folderInfo.GetDirectories();
}
catch
{
return;
}
}
但是总是报错说:E:\c-exe\treeview\index.aspx.cs(56): “Microsoft.Web.UI.WebControls.TreeNode”并不包含对“fullpath”的定义
错误提示语句为:string currentPath=tn.fullpath;
这是怎么回事,我需要怎么做.谢谢!
解决方案 »
- 文件操作里头FileAccess枚举和FileIOPermissionAccess枚举有啥区别
- .net串口读取问题
- 有在Mac OS 上有开发经验的请进
- 问个弱弱的问题
- 关于Convert.ToDateTime的问题
- 求教:
- 请各位高手赐教:怎样终止所有在线操作操作进程?小妹先谢谢大家了!!!
- 菜鸟的报错问题?(在线等)
- 在c#中的下拉组合中如何添加局域网中可用的SQL服务器及相关的数据库。
- 如何访问foxpro数据库?
- 求救:怎样把ftp://方式下载的文件,自动在IE浏览器中打开
- 100分求web form将datagrid表格数据(全是文本)导出为pdf格式源码问题(必须考虑中文编码问题)
这个才有 FullPath 属性呢.----------------------Microsoft.Web.UI.WebControls.TreeNode
这是两个类啊,怎么搞混了??
,它们都有TreeNode属性,那么编译环境会选择前一个来解释