Hello, I have a problem with the args-array. when I compile the code below - I get the error: index was out of array range, so what am I doing wrong? Thank you.
code:
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
-
-
- namespace ConsoleApplication1
- {
- class Program
- {
- static void Main(string[] args)
- {
- int i;
- args[0] = "Jurgen01";
- args[1] = "Jurgen02";
-
-
-
-
-
- if (args.Length > 0)
- {
-
- for (i = 0; i < args.Length; i++)
- Console.WriteLine(args[i]);
- }
- else
- {
- Console.WriteLine("Kein Uebergabestring");
- }
- Console.ReadLine();
- }
- }
- }