我是新的C#wpf編程,但我試圖連接到MySQL數據庫並哈希我的密碼。不幸的是當我執行algorith我得到的錯誤在此代碼:哈希密碼算法問題
byte[] plainTextWithSaltBytes = new byte[plainTextBytes.Length + saltBytes.Length];
salt.CopyTo(plainTextWithSaltBytes, 0);
plainText.CopyTo(plainTextWithSaltBytes, salt.Length);
的錯誤是:
Error: no overload for method 'Copy To' takes 2 arguments Exceptions: System.ArgumentNullException System.ArgumentOutOfRangeException
enter code here
以任何機會,你知道是什麼原因造成這樣的錯誤,以及如何解決它?
plainText的類型是什麼?我懷疑這是一個字符串。您不能將字符串複製到字節數組。 –