HI,
Can anyone tell me how can i search a perticular folder in local machiens harddisk using c#.net 2.0
suraj
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Suraj RaiPosted Jan 5, 2007, 12:25 AM
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
Scott LyslePosted Jan 4, 2007, 9:32 PM
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]);
}
}