J
jarod tupak via .NET 247
(Type your message here)
I have the same problem when executing the code below. It returns me a "126" error from kernel32.
Dim sContainer as String = "sample_example_key"
Dim sProvider as String = "myprovider"
If Not (CryptAcquireContext(lHCryptprov, sContainer, sProvider, PROV_RSA_FULL, 0)) Then
MsgBox("Error " & GetLastError.ToString & " during CryptAcquireContext!")
End If
<DllImport("advapi32.dll")> _
Public Shared Function CryptAcquireContext( _
ByRef hProv As Integer, _
ByVal pszContainer As String, _
ByVal pszProvider As String, _
ByVal dwProvType As Integer, _
ByVal dwFlags As Integer) As Boolean
End Function
Private Declare Function GetLastError Lib "kernel32" () As Long
I have the same problem when executing the code below. It returns me a "126" error from kernel32.
Dim sContainer as String = "sample_example_key"
Dim sProvider as String = "myprovider"
If Not (CryptAcquireContext(lHCryptprov, sContainer, sProvider, PROV_RSA_FULL, 0)) Then
MsgBox("Error " & GetLastError.ToString & " during CryptAcquireContext!")
End If
<DllImport("advapi32.dll")> _
Public Shared Function CryptAcquireContext( _
ByRef hProv As Integer, _
ByVal pszContainer As String, _
ByVal pszProvider As String, _
ByVal dwProvType As Integer, _
ByVal dwFlags As Integer) As Boolean
End Function
Private Declare Function GetLastError Lib "kernel32" () As Long