资源简介
实现类似windows资源管理器功能 实现递归 实时完成资源的管理 提高效率!
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;
using System.Diagnostics;
namespace ResourceManager
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender EventArgs e)
{
AddDriver();
}
///
/// 添加驱动器
///
private void AddDriver()
{
treeView1.BeginUpdate();
treeView1.Nodes.Clear();
DriveInfo[] Drives = DriveInfo.GetDrives();
foreach (DriveInfo drive in Drives )
{
TreeNode node = new TreeNode(drive.Name00);
treeView1.Nodes.Add(node);
AddChildre(node);
}
treeView1.EndUpdate();
}
///
/// 添加子节点
///
/// 父节点
private void AddChildre(TreeNode node)
{
DirectoryInfo[] dirs;
try
{
dirs = new DirectoryInfo(node .FullPath).GetDirectories();
}
catch
{
return;
}
node.Nodes.Clear();
foreach (DirectoryInfo di in dirs)
{
TreeNode node1 = new TreeNode(di.Name12);
node.Nodes.Add(node1);
}
}
///
/// 展开节点前执行
///
///
///
private void treeView1_BeforeExpand(object sender TreeViewCancelEventArgs e)
{
treeView1.BeginUpdate();
TreeNode node = e.Node;
foreach (TreeNode node1 in node.Nodes )
{
AddChildre(node1);
}
treeView1.EndUpdate();
}
///
/// 选择该节点后,将文件夹内的文件显示出来
///
///
///
private void treeView1_AfterSelect(object sender TreeViewEventArgs e)
{
TreeNode node = e.Node;
FileInfo[] f;
e.Node.Expand();
listView1.Items.Clear();
try
{
DirectoryInfo dir=new DirectoryInfo (node .FullPath );
f = dir.GetFiles();
}
catch (Exception)
{
return;
}
foreach (FileInfo f1 in f)
{
ListViewItem lv = new ListViewItem(f1.Name );
lv.ImageIndex = 3;
lv.ToolTipText = “双击打开文件“;
lv.SubItems.A
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 18432 2010-10-23 11:03 ResourceManager\ResourceManager\bin\Debug\ResourceManager.exe
文件 30208 2010-10-23 11:03 ResourceManager\ResourceManager\bin\Debug\ResourceManager.pdb
文件 11600 2010-10-23 13:19 ResourceManager\ResourceManager\bin\Debug\ResourceManager.vshost.exe
文件 490 2010-03-17 22:39 ResourceManager\ResourceManager\bin\Debug\ResourceManager.vshost.exe.manifest
文件 4752 2010-10-23 10:02 ResourceManager\ResourceManager\Form1.cs
文件 11985 2010-10-22 20:15 ResourceManager\ResourceManager\Form1.Designer.cs
文件 11384 2010-10-22 20:15 ResourceManager\ResourceManager\Form1.resx
文件 4440 2010-10-22 08:47 ResourceManager\ResourceManager\obj\x86\Debug\DesignTimeResolveAssemblyReferences.cache
文件 6247 2010-10-23 11:03 ResourceManager\ResourceManager\obj\x86\Debug\DesignTimeResolveAssemblyReferencesInput.cache
文件 252 2010-10-22 20:15 ResourceManager\ResourceManager\obj\x86\Debug\GenerateResource.read.1.tlog
文件 634 2010-10-22 20:15 ResourceManager\ResourceManager\obj\x86\Debug\GenerateResource.write.1.tlog
文件 7897 2010-10-22 08:50 ResourceManager\ResourceManager\obj\x86\Debug\ResolveAssemblyReference.cache
文件 826 2010-10-23 13:19 ResourceManager\ResourceManager\obj\x86\Debug\ResourceManager.csproj.FileListAbsolute.txt
文件 18432 2010-10-23 11:03 ResourceManager\ResourceManager\obj\x86\Debug\ResourceManager.exe
文件 3585 2010-10-22 20:15 ResourceManager\ResourceManager\obj\x86\Debug\ResourceManager.Form1.resources
文件 30208 2010-10-23 11:03 ResourceManager\ResourceManager\obj\x86\Debug\ResourceManager.pdb
文件 180 2010-10-21 20:02 ResourceManager\ResourceManager\obj\x86\Debug\ResourceManager.Properties.Resources.resources
文件 496 2010-10-21 20:00 ResourceManager\ResourceManager\Program.cs
文件 1362 2010-10-21 20:00 ResourceManager\ResourceManager\Properties\AssemblyInfo.cs
文件 2878 2010-10-21 20:00 ResourceManager\ResourceManager\Properties\Resources.Designer.cs
文件 5612 2010-10-21 20:00 ResourceManager\ResourceManager\Properties\Resources.resx
文件 1098 2010-10-21 20:00 ResourceManager\ResourceManager\Properties\Settings.Designer.cs
文件 249 2010-10-21 20:00 ResourceManager\ResourceManager\Properties\Settings.settings
文件 3689 2010-10-21 20:02 ResourceManager\ResourceManager\ResourceManager.csproj
文件 887 2010-10-21 20:00 ResourceManager\ResourceManager.sln
文件 19968 2010-10-23 13:20 ResourceManager\ResourceManager.suo
目录 0 2010-10-21 20:00 ResourceManager\ResourceManager\obj\x86\Debug\TempPE
目录 0 2010-10-23 11:03 ResourceManager\ResourceManager\obj\x86\Debug
目录 0 2010-10-21 20:02 ResourceManager\ResourceManager\bin\Debug
目录 0 2010-10-21 20:00 ResourceManager\ResourceManager\obj\x86
............此处省略8个文件信息
相关资源
- adt-bundle-windows-x86_64-20130917-百度网盘链
- windows操作系统纯净版iso镜像原版系统
- windows运行原理源代码进度条控件
- GDI+绘图功能软件
- MODBUS-CSharp tcp测试正常
- Windows 2003 DNS服务所需的i386目录文件包
- HttpHelper 爬虫应用类库 苏飞万能框架
- CHOLMOD WINDOWS 可直接使用
- windows server 2008 部署MVC5程序的方法
- NI LabWindows CVI 中文教材
- libghttp windows版本移植 源码+库封装+测
- HID USB设备通讯-源代码 UsbLibrary
- Windows Kits
- gperf3.0.1 windows版
- Lua cjson.dll windows动态链接库
- windows下最好用的端口转发软件PassPo
- Windows日志清除及伪造工具
- vs2008下编写带括号计算器
- tomcat-connectors-1.2.40-windows-x86_64-httpd-
- C_#_TCP发送消息和传输文件
-
Syba
seIQ 12.7 for Windows - 注册机获取CPU信息并使用MD5多重加密
- 算法 Point 是否在多边形内
- windows 2008 DNS 与 Linux 同步
- addFlowFor.net 画流程图的
-
nunit.fr
amework.dll很有用的 - windows下fastboot工具
- 仿Windows计算器 Delphi
- SID Change 1.0 (支持所有windows系统)
- DevComponents.DotnetBar控件
评论
共有 条评论