Solved

check availability of words in txt file

Posted on 2009-05-18
2
211 Views
Last Modified: 2013-12-17
i got a txt file in my folder
inside got a list of country name

next i have a textbox , which allows users to input country name
and i need it to check with the country name list in the txt file
list-en1-semic-3.txt
0
Comment
Question by:helloparismiki
2 Comments
 
LVL 1

Accepted Solution

by:
drunk_irishman earned 125 total points
ID: 24413647
think this would work for you.
string[] AllContent = File.ReadAllLines(textfile);
 

foreach (string s in AllContent)

{

   if (s.Contains(TextBox1.Text.ToString()))

            {
 

            }
 

}

Open in new window

0
 
LVL 1

Author Comment

by:helloparismiki
ID: 24414046
i manage to do apply it , thanks ,
but however in the txtfile:-

This list states the country names (official short names in English) in alphabetical...

AFGHANISTAN;AF
ÅLAND ISLANDS;AX


i wanna start read on 3rd line

and instead of read "AFGHANISTAN;AF" , i wanna read "AFGHANISTAN" only
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now