<!-- Article Starts - DO NOT ADD HTML/BODY START TAGS--><!-- Download Links -->
<!-- Article image -->
<!-- Add the rest of your HTML here -->
I am pretty new to the programming world and "VERY" new to the note of C sharp, and have never wrote an article or anything of the like. This will not be the most descriptive page, though "MOST OF THE CODE IS DOCUMENTED" I feel if you download the code and walk thru it, everyone should be able to understand it. I tend to learn at a faster pace by 'doing' first, rather than reading first. ( Always reading after seems to help then go back and step through code again ) Works for me!
I had a small project to do that required a little file.txt manipulation, which frustrated me to no end. There is allot of "Tutorial" style stuff I found on the web, and allot of other unanswered newbies questions but nothing I could get my brain around quickly. So I decided that I would spin my own small project that I could understand. This is not the cleanest and has some error handling in it. (also "I am sure" has plenty of room for improvement so feel free to modify and send or post improvements! :-)
I will try to go thru the code/this article in my free time and add a little more explanation.
Using the code
There are no real surprises here. This code is pretty straight forward. Push a button "Create Directory" and yes you create a directory...Push a button you create a file and so on.
In the win form I removed as much code as possible and converted it to a class "namespace FILE_MODS" & "public class FileIO". Many of these concepts I implemented are from the web, some book's or really bad trial's and some really interesting errors. There is a separate class inside the FileIO for the ListBox and it has some weird errors that would happen during build/run if I didn't add it a false array... (Don't really 100% grasp why) If somebody can review this code, and get some explaination of it that would be awesome.
Also use regex and a few other things I overturned along this road. There are a few links inside the code for where I found the original code, when I remembered to put them there.
(If you see some code that I yanked without links, PLEASE let me know as I would really like to give credit where it is due. )
Points of Interest
This started out as a single windows form only. After which I decided that if I made a class I could reuse it quickly and easily. So that is what I did. Also added a text box to "read" the file into, and a listbox that "loops" through the strings to display a line @ a time.