TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
balasubrahmanyam dola
NA
234
0
Convert.ToUInt32(Marshal.GetLastWin32Error)
Nov 24 2017 6:25 AM
Hi Sir
I am trying to decrypt the encrypted string(.xml file)
IntPtr hCryptProv;
IntPtr hKey = (IntPtr)0;
IntPtr hHash;
string encrString= GetEncryptedConnectionString();
decodedBytes = Convert.FromBase64String(encrString);
decodedBytesLength = decodedBytes.Length;
ePasswordBytes = Encoding.UTF8.GetBytes(ePassword);
// Get a handle to the default provider.
if (!CryptAcquireContext(out hCryptProv, null, null, PROV_RSA_FULL, 0))
{
int error = Marshal.GetLastWin32Error();
uint error1 = Convert.ToUInt32(error );
if (error1 == NTE_BAD_KEYSET)
{
if (!CryptAcquireContext(out hCryptProv, null, null, PROV_RSA_FULL, 8))
if (!CryptAcquireContext(out hCryptProv, null, null, PROV_RSA_FULL, CRYPT_NEWKEYSET))
{
messagebox.show "CryptAcquireContext failed";
}
}
else
{
messagebox.show "CryptAcquireContext failed";
}
}
In the above code error1 value is coming 1150 error code
So please help me why
Reply
Answers (
2
)
DNA Based Computing
nullreferenceexception was unhandled by user code