HI,
Can anyone tell me how can i search a perticular folder in local machiens harddisk using c#.net 2.0
suraj
Searching a perticular folder in harddisk..
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Scott LysleRank #49 · 31K reputationPosted Jan 4, 2007, 4:32 PM EST
This example searches the Temp folder for any jpg files. This uses the asterik to perform a wildcard search for any files with that extension. You can replace that with the name of a specific file to search for something like "mydog.jpg" in the same folder.
The GetFiles functions is overloaded by in this example it accepts two arguments, the search location and the search pattern.
private
void Form1_Load(object sender, EventArgs e){
string[] files;
files = Directory.GetFiles("C:\\Temp", "*.jpg");
for (int i = 0; i < files.Length; i++)
{
listBox1.Items.Add(files[i]);
}
}
Suraj Rai93 reputationPosted Jan 4, 2007, 7:25 PM EST
My application is like the user will get a form with "My Document" icon. When user clicks that icon
I need to keep the folder as backUp in the server.
I need to convert that whole folder into Byte and then send.
Is there sumway to convert this folder into byte before sending it.
Suraj