I have searched for this, but I can't seem to fix my code still.
I am learning C# and watching a tutorial, my code is identical to the video, but I get errors, when the video code works perfect, can anyone see anything wrong with my code?
I am using Visual Studio 2013 if that makes any difference at all.
All it does is call in a file, read it and display the text in a Console window.
I get the following errors: Invalid token '(' in class struct or interface member declaration Invalid token '=' in class struct or interface member declaration Invalid token '{' in class struct or interface member declaration
Error 10 'ConsoleApplication4.Program.inpFile' is a 'field' but is used like a 'type'
Thanks for any help, Adam P.S - Sorry for being such a newb...
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
namespace ConsoleApplication4
{
class Program
{
static void Main(string[] args)
{
LoadFile();
}
private static void LoadFile();
{
StreamReader inpFile = null;
inpFile = File.OpenText("../../well.txt")
Console.WriteLine(inpFile.ReadToEnd());
}
}
}
The problem in the following lines:
write: