M
moondaddy
I'm making the move from vb to C# and am writing some sample code in a
console app. I wanted to write a number of methods each with a different
example test code. the from the main function I wanted to call one of these
test methods. Are additional methods or funtions allowed in a console app?
I'm having trouble referencesing a function from the main function. Can
someone please advise what I should do?
Thanks.
Here's my sample code:
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Test();
//compile error on test().
//Err: The name 'Test' does not exist in the current context
}
public void Test()
{
Console.WriteLine("its working now");
}
}
}
console app. I wanted to write a number of methods each with a different
example test code. the from the main function I wanted to call one of these
test methods. Are additional methods or funtions allowed in a console app?
I'm having trouble referencesing a function from the main function. Can
someone please advise what I should do?
Thanks.
Here's my sample code:
using System;
using System.Collections.Generic;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
Test();
//compile error on test().
//Err: The name 'Test' does not exist in the current context
}
public void Test()
{
Console.WriteLine("its working now");
}
}
}