C
C#2y ago
!Ryzz3nn!

❔ Load txt file

Hello there! im trying to make a simple Windows from application as a test. i currently have 3 forms, one main page, one textpage and one textload page. but i have gotten stuck. im trying to make a function where you press a button that says load on the textpage, that brings up the other form called textload that contains a listbox which shows all .txt files within a certain folder, however when you press load inside the text load i want it to load the content of the selected .txt file and load it into the richtextbox i have on the textpage. which is why i have come here to seek some help as i have not been able to find any solution online. i would also like to apologize for my bad writting.
8 Replies
barcode
barcode2y ago
var files = Directory.EnumerateFiles(path);
var dirs = Directory.EnumerateDirectories(path);
var files = Directory.EnumerateFiles(path);
var dirs = Directory.EnumerateDirectories(path);
barcode
barcode2y ago
File.ReadAllLines Method (System.IO)
Opens a text file, reads all lines of the file into a string array, and then closes the file.
barcode
barcode2y ago
this should lead you to the right direction
!Ryzz3nn!
!Ryzz3nn!OP2y ago
Once I’m home I will be able to look through this and provide some bits of my current code
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server