Ranorex C# code to select an option from a HTML select box/picklist

public void SetPicklistValue (Ranorex.Adapter picklist, string strValue)
{
    for (int i=0; i < pickList.Options.Count ; i++ ) {
        // find the option same as the value to be set
        if (pickList.Options[i].InnerText == strValue) {
            // if options and value are same
            if (pickList.Options[i].InnerText == pickList.Options[i].Value)
            {
                pickList.TagValue = strValue;
            }
            else // if options and values are different
            {
                pickList.TagValue = pickList.Options[i].Value;
            }
	}
    }
}