Of course this is just a snippet, but I was using this to search for a filename that I was inputting into a textbox on a windows form. I don't like it because it takes a great deal of time to search for the file, is there a faster way to use C# to search for a filename?
Code:
try
{
string searchFile = "";
searchFile = txtbox1.Text;
if (searchFile != string.Empty)
{
using (System.Diagnostics.Process pRun = new System.Diagnostics.Process())
{
pRun.StartInfo.FileName = "C:\\" + searchFile + ".doc";
pRun.StartInfo.UseShellExecute = true;
pRun.Start();
}
}
catch
{
}