我爱黑客网首页 设为首页
加入收藏
联系我们
 首 页  技术文章 下载中心 站长学院 交流论坛
 软件:
 文章:        教程:
 推荐: 我爱黑客网论坛
 
 
 
 
   
黑软: Q Q 软件 木马间谍 探嗅监听 溢出攻击 加密解密 漏洞扫描 脚本注入 远程控制 综合利用 聊天工具  
 
技术文章: 爱黑新闻 | 黑客攻防 | 网络技术 | 程序设计 | 系统操作 | 本站动态 | 业界动态 | 安全公告 | 病毒公告 | 八卦黑客
 
 
您当前的位置:我爱黑客 -> 程序设计 -> C++ -> C++文件 -> 文章内容  
栏目导航
· C++综合 · C++通信
· C++视图 · C++图象
· C++系统 · C++多媒体
· C++界面 · C++文件
· C++数据库 · C++网络
热门文章
· 利用C++ Builder 设计..
· 利用C++ Builder设计实..
· 自解密的加密程序的制..
· C++ Builder中各种资源..
· 编写感染COM与EXE文件..
· 如何利用C++ Builder实..
· 文件关联型木马的编程..
· 用Foxmail的地址传播病..
· 共享软件的注册加密法..
· 还未结束就能把自身删..
· 浏览文件的一段代码
· 给想写嵌入式病毒和木..
相关文章

· 用TreeView浏览目录..
· 如何显示/隐藏IE浏览..
· [图文] CSS Hack浏览..
· [图文] 几种浏览器的..
· 病毒借浏览器漏洞肆..
· 火狐浏览器发现安全..
· 是谁控制了我们的浏..
· IE7测试版8月3日亮相..
· 微软、标准组织结缘..
· 雅虎将推beta升级版..
查看更多与浏览文件的一段代码相关内容

浏览文件的一段代码
作者:幽火  来源:www.5ihack.com  发布时间:2007-1-8 19:19:58  发布人:ghostfire

减小字体 增大字体

  #include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
TTreeNode* currnode;
int DirCount,FileCount,DriveCount;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void TForm1::TreeInit(String path, TTreeNode * mynode)
{
TSearchRec sr;
if(FindFirst(path+"\\*.*",faAnyFile,sr)==0)
{
do
{
if((sr.Attr& faDirectory)==faDirectory)
{
if(sr.Name!="." && sr.Name!="..")
{
currnode=TreeView1->Items->AddChild(mynode,sr.Name);
TreeInit(path+"\\"+sr.Name,currnode);
DirCount++;
}
}
/*
else
{
if(path.SubString(1,1)=="A" || path.SubString(1,1)=="B")
{
currnode=TreeView1->Items->AddChild(mynode,sr.Name);
FileCount++;
}
}
*/
}
while(FindNext(sr)==0);
}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormCreate(TObject *Sender)
{
String Drive,path;
DirCount=FileCount=0;
DriveCount=DriveComboBox1->Items->Count;
TreeView1->Items->BeginUpdate();
TreeView1->Items->Clear();
currnode=TreeView1->Items->Add(TreeView1->Selected,"我的电脑");
currnode->Selected=true;
for(int i=0;i<DriveCount;i++)
{
Drive=DriveComboBox1->Items->Strings[i].SubString(1,1);
path=Drive+":";
currnode=TreeView1->Items->AddChild(TreeView1->Selected,DriveComboBox1->Items->Strings[i]);
TreeInit(path,currnode);
}
TreeView1->Items->EndUpdate();
}
//---------------------------------------------------------------------------
void __fastcall TForm1::TreeView1Click(TObject *Sender)
{
int i;
String path;
TTreeNode *node;
node=TreeView1->Selected;
//得到用户选择的当前路径:
if(node->Level)
{//当用户选择的不是根节点时
do
{
if(node->Level==1)
path=node->Text.SubString(1,2)+(path.Length()?"\\":"")+path;
else
path=node->Text+(path.Length()?"\\":"")+path;
node=node->Parent;
}
while(node->Level);
//刷新右边的列表视图:
ListView1->Items->BeginUpdate();
ListView1->Items->Clear();
TSearchRec sr;
if(FindFirst(path+"\\*.*",faAnyFile,sr)==0)
{
TListItem *li;
do
{
if(sr.Name!="." && sr.Name!="..")
{
li=ListView1->Items->Add();
li->Caption=sr.Name;
if(sr.Attr==faDirectory)
{
li->SubItems->Add("");
li->SubItems->Add("文件夹");
}
else
{
li->SubItems->Add(IntToStr(sr.Size));
li->SubItems->Add("文件");
}
li->SubItems->Add(FileDateToDateTime(sr.Time).DateTimeString());
}
}
while(FindNext(sr)==0);
FindClose(sr);
}
ListView1->AlphaSort();
ListView1->Items->EndUpdate();
}
else
{
TListItem *li;
ListView1->Items->BeginUpdate();
ListView1->Items->Clear();
for(i=0;i<TreeView1->Selected->Count;i++)
{
li=ListView1->Items->Add();
li->Caption=TreeView1->Selected->Item[i]->Text;
}
ListView1->Items->EndUpdate();
}
}
//---------------------------------------------------------------------------

查看更多与浏览文件的一段代码相关内容

[ ] [返回上一页] [打 印] [收 藏]
上一篇文章:
下一篇文章:
      给想写嵌入式病毒和木马的人       还未结束就能把自身删除的程序
∷相关文章评论∷   (评论内容只代表网友观点,与本站立场无关!) [发表评论]
 
 
 
 
晋ICP备05008232   维护网络安全、传播安全技术才是我们的目标! 
 
关于本站 - 网站帮助 - - 下载声明 - 友情连接 -网站地图