Click here to Skip to main content
15,913,467 members
Home / Discussions / C#
   

C#

 
AnswerRe: help with data reader Pin
Giorgi Dalakishvili13-Nov-08 8:17
mentorGiorgi Dalakishvili13-Nov-08 8:17 
AnswerRe: help with data reader Pin
PIEBALDconsult13-Nov-08 12:59
mvePIEBALDconsult13-Nov-08 12:59 
QuestionGet Website information from IIS Pin
Pr@teek B@h!13-Nov-08 7:44
Pr@teek B@h!13-Nov-08 7:44 
AnswerRe: Get Website information from IIS Pin
Pr@teek B@h!13-Nov-08 9:45
Pr@teek B@h!13-Nov-08 9:45 
QuestionSearching the inbetweens? Pin
jas0n2313-Nov-08 6:52
jas0n2313-Nov-08 6:52 
AnswerRe: Searching the inbetweens? Pin
Ennis Ray Lynch, Jr.13-Nov-08 7:29
Ennis Ray Lynch, Jr.13-Nov-08 7:29 
AnswerRe: Searching the inbetweens? Pin
sph3rex13-Nov-08 7:49
sph3rex13-Nov-08 7:49 
GeneralRe: Searching the inbetweens? Pin
jas0n2313-Nov-08 18:27
jas0n2313-Nov-08 18:27 
Oh, sorry, I forgot to post the code I mentioned in my Question. Thanks for helping me, both of you Smile | :) It's much appreciated:

using System.IO;
using System.Text.RegularExpressions;

        private void SearchLink_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            if( File.Exists("C:\\Users\\Jase\\Desktop\\Test.txt"))
            {
            // File to search.
            string FileName = "C:\\Users\\Jase\\Desktop\\Test.txt";

            // Reads file to end.
            StreamReader SearchText = new StreamReader(FileName);
            string ReadAll = SearchText.ReadToEnd();

            // SearchTextBox.Text contains string to search for.
            SearchText.Close();
            string regMatch = SearchTextBox.Text;

            // If the string has been found, do something.
            if (Regex.IsMatch(ReadAll, regMatch))
            {
                MessageBox.Show("Found\n" + "" + regMatch);
            }
            else
            {
                MessageBox.Show("Not found\n");
            }
            }
            else
            {
                MessageBox.Show("Non-Existant File.");
            }
        }


The only problem with this code is it requires somebody to enter text into a textbox and then it will search for that text in an existing file. I actually need to just search for anything that is inbetween two quotes ("sample thing").

I tried both of your suggestions and I got a little confused and it didn't work, so I went to MSDN before posting another question here and I left MSDN even more confused. Thanks for your quick replies Smile | :)

j.t.

GeneralRe: Searching the inbetweens? Pin
sph3rex13-Nov-08 22:51
sph3rex13-Nov-08 22:51 
Questionreading bits from a file and manipulate them Pin
arturw8213-Nov-08 6:51
arturw8213-Nov-08 6:51 
AnswerRe: reading bits from a file and manipulate them Pin
Mbah Dhaim13-Nov-08 7:16
Mbah Dhaim13-Nov-08 7:16 
GeneralRe: reading bits from a file and manipulate them Pin
arturw8213-Nov-08 10:18
arturw8213-Nov-08 10:18 
AnswerRe: reading bits from a file and manipulate them Pin
Pr@teek B@h!13-Nov-08 8:07
Pr@teek B@h!13-Nov-08 8:07 
GeneralRe: reading bits from a file and manipulate them Pin
arturw8213-Nov-08 10:52
arturw8213-Nov-08 10:52 
GeneralRe: reading bits from a file and manipulate them Pin
Pr@teek B@h!14-Nov-08 2:56
Pr@teek B@h!14-Nov-08 2:56 
QuestionApplication architecture Pin
DaveKub13-Nov-08 5:17
DaveKub13-Nov-08 5:17 
QuestionGet all names of objects (controls) in a form Pin
Kurt13-Nov-08 5:01
Kurt13-Nov-08 5:01 
AnswerRe: Get all names of objects (controls) in a form Pin
Giorgi Dalakishvili13-Nov-08 5:20
mentorGiorgi Dalakishvili13-Nov-08 5:20 
AnswerRe: Get all names of objects (controls) in a form Pin
Ben Fair13-Nov-08 6:22
Ben Fair13-Nov-08 6:22 
GeneralRe: Get all names of objects (controls) in a form Pin
Kurt13-Nov-08 21:03
Kurt13-Nov-08 21:03 
Questionconverting GSM 6.10 to PCM in c# Pin
f4hd13-Nov-08 4:34
f4hd13-Nov-08 4:34 
AnswerRe: converting GSM 6.10 to PCM in c# Pin
DaveyM6913-Nov-08 5:01
professionalDaveyM6913-Nov-08 5:01 
GeneralRe: converting GSM 6.10 to PCM in c# Pin
f4hd13-Nov-08 5:49
f4hd13-Nov-08 5:49 
GeneralRe: converting GSM 6.10 to PCM in c# Pin
DaveyM6913-Nov-08 15:57
professionalDaveyM6913-Nov-08 15:57 
QuestionException on workflow thread Pin
to_samGmbH13-Nov-08 4:22
to_samGmbH13-Nov-08 4:22 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.