wtorek, 13 grudnia 2016

Files in Windows Directory (Visual C++)



#pragma endregion
DirectoryInfo^ Windows_directory;
private: System::Void button1_Click(System::Object^  sender, System::EventArgs^  e) {
Close();
}
private: System::Void Form1_Load(System::Object^  sender, System::EventArgs^  e) {
Windows_directory=gcnew DirectoryInfo("c:\\Windows" );
    }
private: System::Void button2_Click(System::Object^  sender, System::EventArgs^  e) {
int i;
array<FileInfo^>^dll_files=Windows_directory->GetFiles("*.dll");
array<FileInfo^>^txt_files=Windows_directory->GetFiles("*.txt");
array<FileInfo^>^prx_files=Windows_directory->GetFiles("*.prx");
array<FileInfo^>^dat_files=Windows_directory->GetFiles("*.dat");
array<FileInfo^>^applications=Windows_directory->GetFiles("*.exe");
array<FileInfo^>^etl_files=Windows_directory->GetFiles("*.etl");
array<FileInfo^>^log_files=Windows_directory->GetFiles("*.log");
array<FileInfo^>^dpx_files=Windows_directory->GetFiles("*.dpx");
array<DirectoryInfo^>^directories = Windows_directory->GetDirectories();

for(i=0;i<dll_files->Length;i++)
textBox1->AppendText(dll_files[i]->Name+" - "+dll_files[i]->Length+System::Environment::NewLine);
for(i=0;i<txt_files->Length;i++)
textBox2->AppendText(txt_files[i]->Name+" - "+txt_files[i]->Length+System::Environment::NewLine);
for(i=0;i<prx_files->Length;i++)
textBox3->AppendText(prx_files[i]->Name+" - "+prx_files[i]->Length+System::Environment::NewLine);
for(i=0;i<dat_files->Length;i++)
textBox4->AppendText(dat_files[i]->Name+" - "+dat_files[i]->Length+System::Environment::NewLine);
for(i=0;i<applications->Length;i++)
textBox5->AppendText(applications[i]->Name+" - "+applications[i]->Length+System::Environment::NewLine);
for(i=0;i<etl_files->Length;i++)
textBox6->AppendText(etl_files[i]->Name+" - "+etl_files[i]->Length+System::Environment::NewLine);
for(i=0;i<log_files->Length;i++)
textBox7->AppendText(log_files[i]->Name+" - "+log_files[i]->Length+System::Environment::NewLine);
for(i=0;i<dpx_files->Length;i++)
textBox8->AppendText(dpx_files[i]->Name+" - "+dpx_files[i]->Length+System::Environment::NewLine);
for(i=0;i<directories->Length;i++)
textBox9->AppendText(directories[i]->Name+" - "+directories[i]->CreationTime+System::Environment::NewLine);
}

};
}

Brak komentarzy:

Prześlij komentarz