Results 1 to 7 of 7

Thread: [RESOLVED] Fastest way to Search for a file

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 2010
    Posts
    272

    Resolved [RESOLVED] Fastest way to Search for a file

    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
    {
    }
    Last edited by Jo15765; Aug 16th, 2013 at 03:45 PM. Reason: Copy/Pasted wrong Code

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width