Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Resource file

Status
Not open for further replies.

nwcomer

Programmer
Apr 9, 2007
6
GB


How can I search for string (not key) in an external resource file. (using windows application (c#) )

I have window form where a user enters the resource file path or use open dialog box to select the resource file which is external to this application and then provides the text to search in the resource file.

1) Programmatically search for the text in the external resource file(???)
2) If found - how can edit that text and update the resource file.

Please note that this resource file is not created in the windows form. Its an external file used in the web forms.

Please advise.

 
Is the file in plain text? If so, create a StreamReader object and ReadLine through it until you find the specified search criteria.

The old way was to read each line and output to a new file and then over write the file.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top