Click here to Skip to main content
Click here to Skip to main content

Simple File Creation Form and text manipulation class

By , 24 Feb 2004
Rate this:
Please Sign up or sign in to vote.
<!-- Article Starts - DO NOT ADD HTML/BODY START TAGS--><!-- Download Links --> <!-- Article image -->

Sample Image - Simple_filetxt_routines.gif

<!-- Add the rest of your HTML here -->

Introduction

    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! Smile | :)
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.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

BillyDvd
Web Developer
United States United States
No Biography provided

Comments and Discussions

 
GeneralMy vote of 1 Pinmemberndinges10-Mar-09 3:49 
GeneralAwesome Sample dude Pinmemberjay_t556-Sep-08 0:22 
GeneralLook at your code PinmemberByteGhost9-Mar-04 17:39 
GeneralI'm sorry... PinmemberDavid M. Kean25-Feb-04 12:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web03 | 2.8.140415.2 | Last Updated 25 Feb 2004
Article Copyright 2004 by BillyDvd
Everything else Copyright © CodeProject, 1999-2014
Terms of Use
Layout: fixed | fluid