C# Function question

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hello,
This should be a simple problem to solve, but I'm fairly new to C# and
have been wracking my brains to no avail. I created a new Console
Application in C# beta 2, and entered the following:

using System;
using System.Collections.Generic;
using System.Text;

namespace Test2
{
class Program
{
static void main (string[] args)
{
string a = "qwert";
string b = GetStuff( );
string c = a + b;
Console.WriteLine(c);
}

public string GetStuff( )
{
string c = "poiuy";
return c;
}
}
}

When I compile this, I get the error: "An object reference is required
for the nonstatic field, method, or property 'Test2.Program.GetStuff( )' for
the line: string b = GetStuff( );

I'm not entirely sure what the problem could be, and would appreciate it
if someone help. Thanks.

Scott


.



Relevant Pages

  • Re: Playing ( crit)
    ... It still strikes me that she should have thought a bit harder before ... she?d said brightly in the tone of voice reserved for small ... wracking my brains for something to say when my turn came. ...
    (rec.arts.sf.composition)
  • Problem of combinatorics
    ... I am wracking my brains about a problem of combinatorics, ... There is a sports team of 21 people. ...
    (sci.math)
  • OT: Name that sci-fi book series
    ... I've been wracking my brains for ages trying to remember the name of a book ... transfer his mind to another body, and this bunch of religious nutters were ... The only thing I can say for certain is it wasn't Perry Rhodan. ...
    (rec.arts.drwho)
  • RE: My entire Excel worksheet scrolls down when I hit the enter key. .
    ... I have been wracking my brains out trying to remember how I cleared this up ... "Miz Nettie" wrote: ... > down in the column should be selected; instead the original cell remains ...
    (microsoft.public.excel.programming)