2
由於字符串,我遇到了最後一行代碼的問題。即使我是 使用Microsoft.VisualBasic
命名空間它給我錯誤。system.linq.strings由於其保護級別而無法訪問
private byte[] CreateKey(string strPassword)
{
//Convert strPassword to an array and store in chrData.
char[] chrData = strPassword.ToCharArray();
//Use intLength to get strPassword size.
int intLength = chrData.GetUpperBound(0);
//Declare bytDataToHash and make it the same size as chrData.
byte[] bytDataToHash = new byte[intLength + 1];
//Use For Next to convert and store chrData into bytDataToHash.
for (int i = 0; i <= chrData.GetUpperBound(0); i++) {
bytDataToHash[i] = Convert.ToByte(Strings.Asc(chrData[i]));
}
}