gpt4 book ai didi

.net - '1-dimensional array of byte' 类型的值无法转换为字节

转载 作者:行者123 更新时间:2023-12-01 18:56:32 24 4
gpt4 key购买 nike

我正在尝试将值传递给后台 worker 。我之前发帖询问如何做到here 。一个答案将我引向了这段代码,但我在尝试使用它时遇到了问题。这就是我正在做的事情:

Class MyParameters
Friend strInputFile As String
Friend strOutputFile As String
Friend bytKey As Byte
Friend bytIV As Byte
Friend Direction As New CryptoAction
End Class

.

Private Sub bnEcrypt_Click(sender As Object, e As EventArgs) Handles bnEcrypt.Click
Dim bytKey As Byte()
Dim bytIV As Byte()


'Send the password to the CreateKey function.
bytKey = CreateKey(txtPass.Text)
'Send the password to the CreateIV function.
bytIV = CreateIV(txtPass.Text)

Dim m As New MyParameters
m.strInputFile = txtFile.Text
m.strOutputFile = txtPlaceIn.Text
m.bytKey = bytKey
m.bytIV = bytIV
m.Direction = CryptoAction.ActionDecrypt

但我收到错误:“一维字节数组”类型的值无法转换为字节。关于这两个:

        m.bytKey = bytKey
m.bytIV = bytIV

有什么帮助吗?

最佳答案

您将变量定义为 Byte,而不是字节数组 Byte()

使用这个:

Friend bytKey As Byte()
Friend bytIV As Byte()

关于.net - '1-dimensional array of byte' 类型的值无法转换为字节,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27569980/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com