本文介绍了当索引值是整数数组时,如何获取索引值。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究bbid密码解码器/黑客的vb.net版本。



我发现了一些代码可以创建5x5矩阵字母 - 字母J.

我从C#版转换而来。



I'm working on a vb.net version of the bifid cipher decoder/cracker.

I found some code that will create the 5x5 matrix out of the alphabet - the letter J.
That I converted from a C# version.

Private KeyMatrix As String(,) = New String(4, 4) {}




Private Sub BuildKeyMatrix()
    Dim k As Integer = 65
    For i As Integer = 0 To 4
        For j As Integer = 0 To 4 'index has to start at zero or errors out
            If k = 74 Then
                k += 1
            End If
            ' j’yi alma(j take) (j ascii = 64)
            KeyMatrix(i, j) = Chr(k).ToString()
            k += 1
        Next
    Next
End Sub





通过调试器查看时,您会看到它显示索引/值对为



0,0 A

0,1 B

0,2 C

0,3 D

0,4 E

1,0 F

$ G

1, 2 H

等等



如果我这样做,我可以收到这些信件。





When viewed thru the debugger you see it is showing index / value pair as

0,0 A
0,1 B
0,2 C
0,3 D
0,4 E
1,0 F
1,1 G
1,2 H
and so on

If I do this I can get the letters.

For Each ltr In KeyMatrix
    strbldr.AppendLine(ltr)
Next



但是如何按字母值返回索引数组?

标准索引(of)对数组的索引不起作用。



我可能只使用两个基于零的索引或列表(类型)一个Char和另一个整数数组。


But how do I get the Index array back by letter value ?
A standard Index(of ) does not work for indexs of array.

I may just use two Zero based indexes or list(of type) one of Char and another of the Integer array.

推荐答案


这篇关于当索引值是整数数组时,如何获取索引值。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 18:54
查看更多