C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !






Searching a File in our PC using C# code...................


Posted Date: 03 Jul 2008    Resource Type: Code Snippets    Category: C# Syntax
Author: raviMember Level: Gold    
Rating: Points: 10



the below posted is the code i have used to search a file in C# and it worked for me.......



protected void Page_Load(object sender, EventArgs e)
{
// string []
get(@"F:\");
}

public void get(string s)
{
try
{
if (File.Exists(s + @"\dad.txt"))
{

Response.Write("hmmmm......
");
}


string[] dir = Directory.GetDirectories(s);

foreach (string f in dir)
{
if (f != null)
{
string file = f + @"\rr.txt";
if (File.Exists(file))
{
Response.Write("filepath is " + file);
Response.Write("
");
}
get(f);
}

}
}
catch (Exception e1)
{
//Response.Write(f);
}

}






Responses

Author: ravi    24 Jul 2008Member Level: Gold   Points : 0
isn't the above code useful ???


Author: Raj Kumar Prajapati    27 Aug 2008Member Level: Bronze   Points : 0
ITS WORKING
THANKS
RAJ PRAJAPATI


Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Edit, Update, Delete on Nested DataList in ASP.NET
Previous Resource: Polymorphism
Return to Discussion Resource Index
Post New Resource
Category: C# Syntax


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design


Contact Us    Privacy Policy    Terms Of Use