资源管理器试卷.doc

  1. 1、本文档共19页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
资源管理器 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.IO; using System.Diagnostics; namespace MyExplore { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { TreeNode node; string[] s2; this.treeView1.Nodes[0].Tag = 我ò的?电?脑?; String[] s = Directory.GetLogicalDrives(); //获?取?驱y动ˉ器÷ foreach (string str in s) { treeView1.ImageList.Images.Add(MyFile.GetFileIcon(str, true)); //取?驱y动ˉ器÷图?标括? node = new TreeNode(str, treeView1.ImageList.Images.Count - 1, treeView1.ImageList.Images.Count - 1); //为a每?个?驱y动ˉ器÷生Θ?成é一?个?节ú点? node.Tag = str; //将?驱y动ˉ器÷路·径?保馈?存?到?节ú点?的?Tag属?性?中D this.treeView1.Nodes[0].Nodes.Add(node);//将?每?个?节ú点?添?加ó到?树骸?中D //下?面?的?代洙?码?主÷要癮检ì测a该?驱y动ˉ器÷下?是?否?还1有瓺目?录?,?如?果?有瓺,?则ò在ú该?节ú点?下?加ó入?一?个?文?本?为a“°-1”±的?节ú点?,?目?的?是?为a了?在ú节ú点?前°出?现? +号?,?以?便?展1开a //如?果?该?节ú点?被?展1开a,?要癮首骸?先è将?文?本?为a“°-1”±的?节ú点?删?除y,?然?后ó再ù加ó入?子哩?目?录?内ú容╕。£ try { s2 = Directory.GetDirectories(node.Tag.ToString()); if (s2.Length 0) node.Nodes.Add(new TreeNode(-1, 0, 0)); } catch { } } } //toolStrip布?局?调獭?整?,?重?新?设Θ?置?下?拉?组哩?合?框ò的?宽í度è private void toolStripAddress_Layout(object sender, LayoutEventArgs e) { bPath.Width = this.toolStripAddress.Width - this.toolStripLabel1.Width - toolStripButtonGotoPath.Width - 20; } //当獭?点?击÷左哩?边?红ì色?的?关?闭?图?片?时骸?,?将?splitContainer左哩?边?面?板?折?叠蘴隐皌藏? private void pictureBoxCloseTree_Click(object sender,

文档评论(0)

知识宝库 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档