Click here to Skip to main content
12,693,693 members (30,003 online)
Click here to Skip to main content
Add your own
alternative version


10 bookmarked

Simple File Creation Form and text manipulation class

, 24 Feb 2004
Rate this:
Please Sign up or sign in to vote.
A windows form and class for text & file's.
<!-- 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 -->


    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.


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

Systems / Hardware Administrator Custom Integration Tech
United States United States
No Biography provided

You may also be interested in...

Comments and Discussions

GeneralMy vote of 1 Pin
ndinges10-Mar-09 4:49
memberndinges10-Mar-09 4:49 
GeneralAwesome Sample dude Pin
jay_t556-Sep-08 1:22
memberjay_t556-Sep-08 1:22 
GeneralLook at your code Pin
ByteGhost9-Mar-04 18:39
memberByteGhost9-Mar-04 18:39 
GeneralI'm sorry... Pin
David M. Kean25-Feb-04 13:12
memberDavid M. Kean25-Feb-04 13:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    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 | Terms of Use | Mobile
Web01 | 2.8.170118.1 | Last Updated 25 Feb 2004
Article Copyright 2004 by BillyDvd
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid