Im using the following code to split up a string and store it:
string[] proxyAdrs = linesProxy[i].Split(\':\'); string proxyServer = proxyAdrs[0]; int proxyP
You can check the length of array before accessing its element by index.
Change
if(proxyAdrs[2] != null) { item.Username = proxyAdrs[2]; }
To
if(proxyAdrs.Length > 2 ) { item.Username = proxyAdrs[2]; }