Results 1 to 4 of 4

Thread: Kovan's C# Code for FREE

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,539

    Kovan's C# Code for FREE

    in this thread I will post functions that i write in c# to help anyone else that might need them
    all code will be writen in c#, although some of you are thinking "but i want vb.net code" no fear, there is 2 options

    1. I will provide the c# raw functions (copy n paste into yoru app)
    2. Provide DLL's that you can use in in c# apps or vb.net apps
    (code will still be in c# in the dll but of course it can be used in vb)
    3. if someone requests a function to actually want a copy in vb.net code, am sure that wont be a major problem

    if you have a function that YOU wrote please post it
    (make sure it has a lot of comments for people to undrestand and so on)

    so far i have released

    1. 2 XML Functions

  2. #2
    Hyperactive Member thinktank2's Avatar
    Join Date
    Nov 2001
    Location
    Arctic
    Posts
    272
    Put all those codes under "Kovan" namespace...

  3. #3

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,539

    fileContentToArray

    PHP Code:
    /// <summary>
    ///        This function takes a input parameter of string which contains the path to 
    ///        the file and reads the content of that file into a array list and returns that 
    ///        array list.
    /// </summary>
    /// <Version>1.0</Version>
    /// <Author>
    ///        Kovan Abdulla
    ///        [email][email protected][/email]
    ///        [url="http://www.imetasoft.com"]http://www.imetasoft.com[/url]
    ///    </Author>
    /// <LibrariesRequired>
    ///        using System.IO;
    ///        using System.Collection;
    ///        using System.Windows.Forms;
    /// </LibrariesRequired>
    /// <returns>ArrayList</returns>
    /// <Usage>
    ///        ArrayList  arrList = fileContentToArrayList(@"c:\\myfile.txt")
    ///        for(int i = 0; i < arrList.Count; i++)
    ///            MessageBox.Show(arrList[i].toString()); 
    ///</Usage>
            
    private ArrayList fileContentToArrayList(string filePath)
            {
                
                
    ArrayList arrListLines = new ArrayList();
                try
                {                
                    
    StreamReader fl = new StreamReader(filePath); 
                    while(
    fl.ReadLine() != null )
                    {
                        
    arrListLines.Add(fl.ReadLine());                
                    }
                }
                catch(
    Exception e)
                {
                    
    MessageBox.Show(e.Message"Failed reading file");
                    return 
    null;
                }
                return 
    arrListLines;
            } 

  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,539
    Originally posted by thinktank2
    Put all those codes under "Kovan" namespace...
    at the end, they will be compiled into classes
    each class containing functions that relate to the class name
    like
    myFile.cs will contain all the functions related to Files
    myDatabase.cs will contain all the functions related to databases and so on

    and putting them in a namepsace is not a problem

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width