Just off the top of my head, I write in vb, not that quick in c sharp. But I put about 10 minutes into it just to test 1 char. I would have to come back to convert the program to test char positions 2-4-6-7. I'm a little fuzzy on integer array, in which I can loop the Integer array of p1 to test 2-4-6-7 in the same loop, and produce a exit code such as 0 for success or 1 for failure.
If I used the integer array of p1 for looping, I could just match the int value to the char position much faster. But that's my weakness.
Dim p1() asInteger = 2467
Anyways this is just a starter thought
ProtectedSub Page_Load(sender AsObject, e As System.EventArgs) HandlesMe.Load
Dim uPassword() AsChar = "fortune"Dim p1 AsInteger = 2Dim p1c AsChar = "r"Dim pMatch AsInteger = 1Dim input(uPassword.Length - 1) AsCharFor i AsInteger = 0To uPassword.Length - 1'Just building the password char array to validate the thought
input(i) = uPassword(i)
If (p1 = i) ThenIf (uPassword(i) = p1c) Then
pMatch = 0EndIfEndIfNext
Response.Write("<span style=""color: black;"">" & input & "</span>" & _
"<br /><span style=""color: black;"">" & pMatch.ToString & "</span>")