how do you pass a filename parameter to the main function

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • abaker992
    New Member
    • Apr 2016
    • 1

    how do you pass a filename parameter to the main function

    Im trying to pass a filename parameter from the function to the main functio:

    Code:
    using System;
    using System.Text;
    using System.IO;
    
    namespace Reaingthingyiles
    
    {
    	class program{
            
    
            public static void  checkit(StreamReader file)
            
    	{
    		StreamReader thingy = new StreamReader(thingy);
        	while(!thingy.EndOStream)
        	{
        		string line = thingy.ReadLine();
        		Console.WriteLine(line);
    
        	}
          
        }
    
        
        static void Main()
        {
        	checkit(new StreamReader (@"data.txt"));
           
        }
      }
    
    }
    Im failing horribly I need some direction.
    Last edited by Rabbit; Apr 25 '16, 05:25 PM. Reason: Please use [code] and [/code] tags when posting code or formatted data.
  • madankarmukta
    Contributor
    • Apr 2008
    • 308

    #2
    May I please know what exactly you want to achieve?

    Comment

    Working...