我用treeview作树型菜单,想把我的桌面做为根节点,然后从我的桌面开始遍历,桌面上的东西都能显示出来
可是我不知道该如何定位。。哪位做过??紧急阿

解决方案 »

  1.   

    源代码没带身边,不能给你这个文章里面有程序下
    http://blog.csdn.net/qqwwee_com/archive/2005/09/05/471968.aspx我没记错的话,遍历目录和文件是单独写在一个dll里面的
    你反编译看看。。====CSDN 小助手 V2.0 2005年10月16日发布====
    CSDN小助手是一款脱离浏览器也可以访问Csdn论坛的软件
    界面:http://blog.csdn.net/Qqwwee_Com/archive/2005/10/16/504620.aspx
    下载:http://szlawbook.com/csdnv2/csdnv2.rar为神六喝彩,向所有科技工作者致敬!
    拒绝日货。
      

  2.   

    1.Nodes.add("Desktop") //the root node
    2.Nodes.add(file) //files on the desktop
    3.Nodes.add(folder) //folder on the desktop 递归这个 ---〉step2
      

  3.   

    string deskPath=System.Environment.GetFolderPath(System.Environment.SpecialFolder.Desktop);//返回桌面下的文件夹
    foreach(string d in System.IO.Directory.GetDirectories(deskPath))
    {}//返回桌面下的文件
    foreach(string f in System.IO.Directory.GetFiles(deskPath))
    {}