Indexes in arrays start with 0. So array with 1000 elements will have indexes from 0 to 999. It throws at the 1000th index. As a solution, you can change your loop to have following condition: i < 1000 instead.
More Related Contents:
- Merge two arrays and return sorted array in c# [closed]
- CMD command on c#
- Interop type cannot be embedded
- How to detect a process start & end using c# in windows?
- Impersonate user in Windows Service
- Can’t run program because it asks me to attach on process
- How to put char ('X') to int array?
- How to use C# 7 with Visual Studio 2015?
- Parallel.ForEach vs Task.Factory.StartNew
- Dynamically adding properties to an ExpandoObject
- pinvokestackimbalance — how can I fix this or turn it off?
- How to fix “Referenced assembly does not have a strong name” error
- How to get the z-order in windows?
- Visual Studio: ContextSwitchDeadlock
- How to overcome Stack Size issue with Visual Studio (running C codes with big array)
- What’s the best way to calculate the size of a directory in .NET?
- File getting copied to SysWOW64 instead of System32
- Windows service with timer
- C# – Making a Process.Start wait until the process has start-up
- Determine assembly version during a post-build event
- Copy Arrays to Array
- Data binding directly to a store query (DbSet, DbQuery, DbSqlQuery) is not supported
- Get chrome browser title using c#
- visual studio 2010 conditional references
- Domain credentials for a WebClient class don’t work
- How to get recommended programs associated with file extension in C#
- Shortcut to create properties in Visual Studio?
- C# Regex to match the word with dot
- WPF C# InputBox
- Print html document from Windows Service in C# without print dialog