Hjælp begynderen med funktioner!
Hej eksperter!Vil I hjælpe mig med en kode?
Jeg er rimelig ny til C#, så jeg kan ikke se, hvor fejlen er - så I får hele koden:
using System;
using System.Collections.Generic;
using System.Text;
namespace Drivers
{
class Program
{
static void Main()
{
System.ConsoleKeyInfo KEY;
Console.WriteLine("ACER ASPIRE 9410 SERIES SETUP");
Console.SetCursorPosition(0, 3);
Console.WriteLine("Welcome to the Acer Aspire 9410 series setup version 1.1 by Toke!");
Console.SetCursorPosition(1, 5);
Console.WriteLine("- Press <ENTER> to proceed.");
Console.SetCursorPosition(1, 7);
Console.WriteLine("- Press any other key to cancel.");
KEY = Console.ReadKey();
if (KEY.Key.ToString() == "Enter")
{
GET_DIR();
}
}
static void GET_DIR()
{
private System.String DIR;
Console.Clear();
Console.WriteLine("ACER ASPIRE 9410 SERIES SETUP");
Console.SetCursorPosition(1, 3);
Console.WriteLine("- Enter the destination directory and press <ENTER> to copy files.");
Console.SetCursorPosition(3, 4);
Console.WriteLine("Destination directory:");
Console.SetCursorPosition(26, 4);
DIR = Console.ReadLine();
if (DIR != "")
{
COPY_FILES(DIR);
}
else
{
GET_DIR();
}
}
static void COPY_FILES(System.String DIR)
{
private System.String DIR;
// Og så noget mere kode her...
}
}
}
Overstående retunerer så:
Error 1 } expected C:\Documents and Settings\Charlotte.TOKEN\Local Settings\Application Data\Temporary Projects\Drivers\Program.cs 27 10 Drivers
Error 2 Invalid token '(' in class, struct, or interface member declaration C:\Documents and Settings\Charlotte.TOKEN\Local Settings\Application Data\Temporary Projects\Drivers\Program.cs 29 26 Drivers
Error 3 Invalid token '(' in class, struct, or interface member declaration C:\Documents and Settings\Charlotte.TOKEN\Local Settings\Application Data\Temporary Projects\Drivers\Program.cs 30 30 Drivers
Error 4 Invalid token '(' in class, struct, or interface member declaration C:\Documents and Settings\Charlotte.TOKEN\Local Settings\Application Data\Temporary Projects\Drivers\Program.cs 31 38 Drivers
Error 5 Invalid token '(' in class, struct, or interface member declaration C:\Documents and Settings\Charlotte.TOKEN\Local Settings\Application Data\Temporary Projects\Drivers\Program.cs 32 30 Drivers
Error 6 Invalid token '(' in class, struct, or interface member declaration C:\Documents and Settings\Charlotte.TOKEN\Local Settings\Application Data\Temporary Projects\Drivers\Program.cs 33 38 Drivers
Error 7 Invalid token '(' in class, struct, or interface member declaration C:\Documents and Settings\Charlotte.TOKEN\Local Settings\Application Data\Temporary Projects\Drivers\Program.cs 34 30 Drivers
Error 8 Invalid token '(' in class, struct, or interface member declaration C:\Documents and Settings\Charlotte.TOKEN\Local Settings\Application Data\Temporary Projects\Drivers\Program.cs 35 38 Drivers
Error 9 Invalid token '=' in class, struct, or interface member declaration C:\Documents and Settings\Charlotte.TOKEN\Local Settings\Application Data\Temporary Projects\Drivers\Program.cs 36 17 Drivers
Error 10 Invalid token '(' in class, struct, or interface member declaration C:\Documents and Settings\Charlotte.TOKEN\Local Settings\Application Data\Temporary Projects\Drivers\Program.cs 36 35 Drivers
Error 11 Invalid token '!=' in class, struct, or interface member declaration C:\Documents and Settings\Charlotte.TOKEN\Local Settings\Application Data\Temporary Projects\Drivers\Program.cs 37 21 Drivers
Error 12 Class, struct, or interface method must have a return type C:\Documents and Settings\Charlotte.TOKEN\Local Settings\Application Data\Temporary Projects\Drivers\Program.cs 39 17 Drivers
Error 13 Identifier expected C:\Documents and Settings\Charlotte.TOKEN\Local Settings\Application Data\Temporary Projects\Drivers\Program.cs 39 31 Drivers
Error 14 A namespace does not directly contain members such as fields or methods C:\Documents and Settings\Charlotte.TOKEN\Local Settings\Application Data\Temporary Projects\Drivers\Program.cs 41 13 Drivers
Error 15 Expected class, delegate, enum, interface, or struct C:\Documents and Settings\Charlotte.TOKEN\Local Settings\Application Data\Temporary Projects\Drivers\Program.cs 47 16 Drivers
Error 16 Expected class, delegate, enum, interface, or struct C:\Documents and Settings\Charlotte.TOKEN\Local Settings\Application Data\Temporary Projects\Drivers\Program.cs 49 21 Drivers
Error 17 Type or namespace definition, or end-of-file expected C:\Documents and Settings\Charlotte.TOKEN\Local Settings\Application Data\Temporary Projects\Drivers\Program.cs 51 9 Drivers
Hvad er der galt?
