Click here to Skip to main content
15,885,876 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Search for a text file in textbox in a particular directory (ex : D:/Logs/) and open and edit the text's in the text file in a new form each line of text from text file on separate textbox in new form.

What I have tried:

Dont know how to do it cant get any ideas need help with it
Posted
Updated 18-Mar-18 18:55pm

1 solution

Hi, let's break down your problem-

1. You need to search files in a given directory
Directory.GetFiles Method (String, String) (System.IO)[^]
How to: Read From Text Files in Visual Basic | Microsoft Docs[^]

2. Read a text file
How to: Read From a Text File (C# Programming Guide) | Microsoft Docs[^]

3. with System.IO.File.ReadAllLines you'd be able to get the array of the lines, and populate each line in the textbox (TIP: use for loop. :) ).

Hope this helps.


KR
 
Share this answer
 
v2
Comments
Maciej Los 19-Mar-18 4:03am    
5ed!
Krunal Rohit 20-Mar-18 0:46am    
Thanks!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900