You should store the result of IndexOf()
and use that.
var result = Array.IndexOf(myarray, myvalue);
if ( result > -1 )
Console.WriteLine("the value existe in myarray[" + result + "]");
solved Is there a way to get the index value when using …. Array.IndexOf? [closed]