樓術描述項:
(1).該項目中"我的電腦"是作者自定義的root節點,沒有設定其路徑,所以BeforeExpand事件中會從它開始依次遍歷,但"我的電腦"會提示"沒有指定路徑".故需要if(e.Tag.ToString() != "我的電腦")判斷.同時"我的文檔"需要再次獲取其路徑,依次實現Add子節點;
(2).同時在"我的文檔"和盤符中需要添加tNode.Nodes.Add("")加載空節點形成+號,如果沒有該+號,BeforeExpend事件不會被調用,子目錄無法獲取加載,在BeforeExpand事件調用TreeViewItems.Add加載其子結點需要e.Nodes.Clear();清除該結點的子目錄再加載.
(3).提供兩篇類似文章供大家學習,經過對比可以發現:第一篇僅從驅動器(C盤)開始加載,所以BeforeExpend簡單展開子目錄即可,不需要判斷"我的電腦"和"我的文檔".第二篇含"桌面",因此需要判斷路徑:"C# TreeView磁盤文件,AfterSelect顯示加號-駱駝祥子" 和"Treeview樹狀顯示文件夾" .同時補充一篇很優秀的文章供大家學習"WinForm應用:ListView做圖像瀏覽"
(4).補充TreeView(樹視圖)事件:更詳細見"c# 樹狀視圖(TreeView類)".
事件 描述
AfterCheck 在選中節點復選框后引發
AfterCollapse 在折疊一個節點后引發
AfterExpand 在擴展一個節點后引發
AfterSelect 在選中一個節點后引發
BeforeCheck 在選中節點復選框之前引發
BeforeCollapse 在折疊一個節點之前引發
BeforeExpand 在擴展一個節點之前引發
BeforeSelect 在選中一個節點之前引發
(5).補充兩個關于論壇討論"c#怎樣動態讀取資源文件里的圖片"和"在C#中怎么調用Resources文件中的圖片"
(6).在《C#典型模塊與項目實戰大全》(清華大學出版社-丁士鋒)書中談到,出于對程序響應性能考慮,它先加載盤符結點,沒有使用遞歸一次性加載所有文件到樹狀列表中,代碼通過AfterSelect事件和FileSystemWatcher控件,監聽加載.并使用線程池task更新加載TreeView,希望大家去學習.
總結
該篇通過TreeView加載了磁盤目錄路徑,并通過ImageList加載圖標.那么怎樣實現閱讀文件夾下文件,獲取其圖標、文件大小、擴展名等信息,并雙擊打開文件呢?下一篇將接著講述.最后希望該文章對大家有所幫助,文章中很多鏈接都可以供覺得有用的同學學習,感謝上面提到的文章及書籍作者.同時如果文章中有錯誤或不足之處請原諒,有問題或建議者亦可提出.希望尊重作者勞動果實勿噴.
標簽:
目錄樹
自定義
上傳時間:
2016-08-15
上傳用戶:baobao9437
Identification is pervasive nowadays in daily life due to many complicated activities such as
bank and library card reading, asset tracking, toll collecting, restricted access to sensitive data
and procedures and target identification. This kind of task can be realized by passwords, bio-
metric data such as fingerprints, barcode, optical character recognition, smart cards and radar.
Radiofrequencyidentification(RFID)isatechniquetoidentifyobjectsbyusingradiosystems.
It is a contactless, usually short distance, wireless data transmission and reception technique
for identification of objects. An RFID system consists of two components: the tag (also called
transponder) and the reader (also called interrogator).
標簽:
Processing
Digital
Signal
RFID
for
上傳時間:
2020-06-08
上傳用戶:shancjb