Searching randomly
-
Hello friends, how can I search for a file say 'filename.txt' randomly in the C: drive? The drive contains many folders and sub-directories, and thus I want to have a thorough search into all the folders and subdirectories present in the drive for the particular file. Please tell me how. NOTE: I dont know the names of the directories that are present in the drive. Hope to recieve help from you guys soon, Rajdeep.NET :rolleyes:
-
Hello friends, how can I search for a file say 'filename.txt' randomly in the C: drive? The drive contains many folders and sub-directories, and thus I want to have a thorough search into all the folders and subdirectories present in the drive for the particular file. Please tell me how. NOTE: I dont know the names of the directories that are present in the drive. Hope to recieve help from you guys soon, Rajdeep.NET :rolleyes:
You obviously have an internet conenction because you're posting here, so I suggest you navigate to http://www.google.com/[^] and search 'c# file search'.
My failometer is detecting vast quantities of FAIL! "Its SQL - hardly programming..." (Caslen)
-
You obviously have an internet conenction because you're posting here, so I suggest you navigate to http://www.google.com/[^] and search 'c# file search'.
My failometer is detecting vast quantities of FAIL! "Its SQL - hardly programming..." (Caslen)
Can you show sample code please. Thank you very much.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
-
Can you show sample code please. Thank you very much.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
public Answer GoogleSearch(string question)
{
try
{
User.EngageBrain(); //Throws exception here.... please(or plz) help.
User.NavigateToGoogle();
return User.SearchForAnswer(question);
}
catch (StupidityException fail)
{
return (Answer)fail.Message;
}
}Hope that helps.
My failometer is detecting vast quantities of FAIL! "Its SQL - hardly programming..." (Caslen)
-
public Answer GoogleSearch(string question)
{
try
{
User.EngageBrain(); //Throws exception here.... please(or plz) help.
User.NavigateToGoogle();
return User.SearchForAnswer(question);
}
catch (StupidityException fail)
{
return (Answer)fail.Message;
}
}Hope that helps.
My failometer is detecting vast quantities of FAIL! "Its SQL - hardly programming..." (Caslen)
OK, have some vegemite :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: PS: got a compiler error (not all code paths return a value""), plz help.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
-
OK, have some vegemite :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: :vegemite: PS: got a compiler error (not all code paths return a value""), plz help.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
-
Hello friends, how can I search for a file say 'filename.txt' randomly in the C: drive? The drive contains many folders and sub-directories, and thus I want to have a thorough search into all the folders and subdirectories present in the drive for the particular file. Please tell me how. NOTE: I dont know the names of the directories that are present in the drive. Hope to recieve help from you guys soon, Rajdeep.NET :rolleyes:
//assumes the file definitely exists. If it might not you'll need to add a counter and abort the search after X attempts, where X >> numValidPathChars^260 (260 = max normal path name)).
fileNotFound = true;
while (fileNotFound)
{
pathToTest = GetRandomPath();
fileNotFound = (FileIsInDirectory(pathToTest,fileName);
}It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains. -- Pride and Prejudice and Zombies
-
Hello friends, how can I search for a file say 'filename.txt' randomly in the C: drive? The drive contains many folders and sub-directories, and thus I want to have a thorough search into all the folders and subdirectories present in the drive for the particular file. Please tell me how. NOTE: I dont know the names of the directories that are present in the drive. Hope to recieve help from you guys soon, Rajdeep.NET :rolleyes:
-
Can you show sample code please. Thank you very much.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.