?
Solved

check availability of words in txt file

Posted on 2009-05-18
2
Medium Priority
?
236 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 375 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
In real business world data are crucial and sometimes data are shared among different information systems. Hence, an agreeable file transfer protocol need to be established.
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …
Suggested Courses
Course of the Month16 days, 21 hours left to enroll

862 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