資源簡介
學習C#所編寫的一個應(yīng)用
仿照我的電腦對文件進行簡單的操作
注意:對文件的操作會真的執(zhí)行!比如刪掉一個文件就真的刪了!

代碼片段和文件信息
using?System;
using?System.Collections.Generic;
using?System.Collections;
using?System.ComponentModel;
using?System.Data;
using?System.Drawing;
using?System.Linq;
using?System.Text;
using?System.Threading.Tasks;
using?System.Windows.Forms;
using?System.IO;
using?System.Diagnostics;
namespace?FileManage
{
????public?partial?class?FileManager?:?Form
????{
????????#region?通用數(shù)據(jù)
????????private?VisitedPath?visitedPath;
????????private?FileProperty?fileProperty;
????????private?ListViewItemDealer?fileDealer;//單例模式
????????private?ListViewItem?item;
????????#endregion
????????#region?初始化
????????///?
????????///?初始化
????????///?
????????public?FileManager()
????????{
????????????InitializeComponent();
????????????InitTreeView();
????????????comboBoxCurAddress.Text?=?“我的電腦“;
????????????InitListView();
????????????visitedPath?=?new?VisitedPath(buttonGoBack?buttonGoFront);
????????????fileProperty?=?new?FileProperty(string.Empty);
????????????fileDealer?=?ListViewItemDealer.CreateDealer();
????????}
????????///?
????????///?初始化樹圖
????????///?
????????void?InitTreeView()
????????{
????????????string[]?Pans?=?Directory.GetLogicalDrives();//盤符
????????????foreach?(string?pan?in?Pans)
????????????{
????????????????TreeNode?node?=?treeViewDirectory.Nodes.Add(pan);
????????????????node.ImageIndex?=?0;
????????????}
????????}
????????///?
????????///?初始化瀏覽窗口
????????///?
????????void?InitListView()
????????{
????????????ResetListViewColumn();//列標題
????????????ImageList?bigimagelist?=?new?ImageList();//大圖標
????????????bigimagelist.ColorDepth?=?ColorDepth.Depth32Bit;
????????????bigimagelist.ImageSize?=?new?System.Drawing.Size(64?64);
????????????bigimagelist.Images.Add(Properties.Resources.disk);
????????????bigimagelist.Images.Add(Properties.Resources.folder);
????????????bigimagelist.Images.Add(Properties.Resources.txt);
????????????bigimagelist.Images.Add(Properties.Resources.picture);
????????????bigimagelist.Images.Add(Properties.Resources.video);
????????????bigimagelist.Images.Add(Properties.Resources.exe);
????????????bigimagelist.Images.Add(Properties.Resources.zip);
????????????bigimagelist.Images.Add(Properties.Resources.file);
????????????listViewFileAndDirectory.LargeImageList?=?bigimagelist;
????????????ImageList?smallimagelist?=?new?ImageList();//小圖標
????????????smallimagelist.ColorDepth?=?ColorDepth.Depth32Bit;
????????????smallimagelist.Images.Add(Properties.Resources.disk);
????????????smallimagelist.Images.Add(Properties.Resources.folder);
????????????smallimagelist.Images.Add(Properties.Resources.txt);
????????????smallimagelist.Images.Add(Properties.Resources.picture);
????????????smallimagelist.Images.Add(Properties.Resources.video);
????????????smallimagelist.Images.Add(Properties.Resources.exe);
????????????smallimagelist.Images.Add(Properties.Resources.zip);
????????????smallimagelist.Images.Add(Propert
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
????..A..H.?????60928??2016-01-02?22:51??FileManage\.vs\FileManage\v14\.suo
?????文件????????187??2015-11-16?17:54??FileManage\FileManage\App.config
?????文件???????2048??2015-11-25?15:41??FileManage\FileManage\bin\Debug\bugs(3).txt
?????文件???????2048??2015-11-25?15:41??FileManage\FileManage\bin\Debug\data(3).txt
?????文件?????392192??2015-11-26?09:22??FileManage\FileManage\bin\Debug\FileManage.exe
?????文件????????187??2015-11-16?17:54??FileManage\FileManage\bin\Debug\FileManage.exe.config
?????文件?????140800??2015-11-26?09:22??FileManage\FileManage\bin\Debug\FileManage.pdb
?????文件??????22696??2016-01-02?22:14??FileManage\FileManage\bin\Debug\FileManage.vshost.exe
?????文件????????187??2015-11-16?17:54??FileManage\FileManage\bin\Debug\FileManage.vshost.exe.config
?????文件????????490??2015-10-30?15:19??FileManage\FileManage\bin\Debug\FileManage.vshost.exe.manifest
?????文件?????225280??2015-11-12?08:55??FileManage\FileManage\bin\Debug\ICSharpCode.SharpZipLib.dll
?????文件???????6034??2015-11-22?10:21??FileManage\FileManage\FileManage.csproj
?????文件??????47354??2015-12-02?21:15??FileManage\FileManage\FileManager.cs
?????文件??????56998??2015-11-26?08:32??FileManage\FileManage\FileManager.Designer.cs
?????文件??????48079??2015-11-26?08:32??FileManage\FileManage\FileManager.resx
?????文件???????4878??2015-11-26?09:05??FileManage\FileManage\FileProperty.cs
?????文件????????846??2015-11-25?14:17??FileManage\FileManage\FilePropertyCollection.cs
?????文件???????2604??2015-11-25?14:55??FileManage\FileManage\FilePropertyWindow.cs
?????文件???????8074??2015-11-25?13:34??FileManage\FileManage\FilePropertyWindow.Designer.cs
?????文件???????5817??2015-11-25?13:34??FileManage\FileManage\FilePropertyWindow.resx
?????文件???????4173??2015-11-22?10:01??FileManage\FileManage\ForeAndBackColorWindow.cs
?????文件???????8849??2015-11-22?09:54??FileManage\FileManage\ForeAndBackColorWindow.Designer.cs
?????文件???????6016??2015-11-22?09:54??FileManage\FileManage\ForeAndBackColorWindow.resx
?????文件?????225280??2015-11-12?08:55??FileManage\FileManage\ICSharpCode.SharpZipLib.dll
?????文件??????16839??2015-11-26?08:50??FileManage\FileManage\ListViewItemDealer.cs
?????文件???????1452??2016-01-02?22:14??FileManage\FileManage\obj\Debug\DesignTimeResolveAssemblyReferences.cache
?????文件???????8337??2016-01-01?14:51??FileManage\FileManage\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache
?????文件???????1888??2016-01-02?22:14??FileManage\FileManage\obj\Debug\FileManage.csproj.FileListAbsolute.txt
?????文件???????1488??2015-11-26?08:32??FileManage\FileManage\obj\Debug\FileManage.csproj.GenerateResource.Cache
?????文件???????6366??2015-11-21?19:40??FileManage\FileManage\obj\Debug\FileManage.csprojResolveAssemblyReference.cache
............此處省略48個文件信息
評論
共有 條評論