我有我的代码将字符串解密为数字,但每次“-1-1-1”我都有结果
protected void submit_Click(object sender, EventArgs e)
{
decryptScore(txtscore.Text);
}
public string decryptScore(string s)
{
string[] firstDigitArray = { "f85au", "kt50e", "cmt5s", "v5072", "fc5i3", "56f7l", "7gj81", "yn90y", "5o3ko", "ntakn" };
string[] secondDigitArray = { "hkym6", "xj97c", "54v6q", "nawf9", "9e1gp", "9gww9", "5oj5p", "0ba5t", "yizld", "bt064" };
string[] thirdDigitArray = { "uku91", "rn2k4", "uuq78", "nkurt", "8kxqs", "9p7kc", "hd8x6", "57b6o", "7iucu", "do6bq" };
string[] fourthDigitArray = { "0hdro", "0wqrc", "wa5ny", "857mg", "3f7ro", "kerph", "0mhw1", "tpb8f", "8rho3", "4hc11" };
string[][] digitsArray = {firstDigitArray, secondDigitArray, thirdDigitArray, fourthDigitArray};
string decryptedScore = "";
int scorelength = s.Length / 5;
for (int i = 0; i < scorelength; i++)
{
string d = s.Substring(i * 5, 5);
decryptedScore += (digitsArray[i][i].IndexOf(d));
}
score.Text = decryptedScore;
return decryptedScore;
}