|
![]() |
Overclock.net - Overclocking.net > Software, Programming and Coding > Coding and Programming | |
VB Password And Variables
|
||
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 (permalink) | |||||||||||||
|
Programmer
|
How Do I use the password template??? and also how can i store variables like from the Masked Text Box???
__________________
Lovin My PS3
Playstation Network ID: MTPAPA121
Last edited by BFRD : 02-21-07 at 06:36 PM. |
|||||||||||||
|
|
|
|
|
#2 (permalink) | |||||||||||||
|
<= Humanaut
|
For convenience, I store variables in INI files using 3DES encryption. I use the M$ crypto API.
Public Function Encrypt(ByVal strText As String, ByVal Key As String) As String Dim byKey(1) As Byte Dim IV() As Byte = {&H12, &H34, &H56, &H78, &H90, &HAB, &HCD, &HEF} Try byKey = System.Text.Encoding.UTF8.GetBytes(Left(Key, 7)) Dim des As New DESCryptoServiceProvider Dim inputByteArray() As Byte = System.Text.Encoding.UTF8.GetBytes(strText) Dim ms As New MemoryStream Dim cs As New CryptoStream(ms, des.CreateEncryptor(byKey, IV), CryptoStreamMode.Write) cs.Write(inputByteArray, 0, inputByteArray.Length) cs.FlushFinalBlock() Return Convert.ToBase64String(ms.ToArray()) Catch ex As Exception MsgBox(ex.Message) Return "" End Try End Function Public Function Decrypt(ByVal strText As String, ByVal Key As String) As String Dim byKey(1) As Byte Dim IV() As Byte = {&H12, &H34, &H56, &H78, &H90, &HAB, &HCD, &HEF} Dim inputByteArray(strText.Length) As Byte Try byKey = System.Text.Encoding.UTF8.GetBytes(Left(Key, 7)) Dim des As New DESCryptoServiceProvider inputByteArray = Convert.FromBase64String(strText) Dim ms As New MemoryStream Dim cs As New CryptoStream(ms, des.CreateDecryptor(byKey, IV), CryptoStreamMode.Write) cs.Write(inputByteArray, 0, inputByteArray.Length) cs.FlushFinalBlock() Dim encoding As System.Text.Encoding = System.Text.Encoding.UTF8 Return encoding.GetString(ms.ToArray()) Catch ex As Exception MsgBox(ex.Message) Return "" End Try End Function
__________________
Previous Member of Team Owners - 1st to hit 200k and 250K![]() Previous member of Rough Riders - 1st to hit 300k!!!![]() Adios everyone! I've been proud to be a member of Owners and Riders.
|
|||||||||||||
|
|
|
|
#3 (permalink) | |||||||||||||
|
Programmer
|
thank you
__________________
Lovin My PS3
Playstation Network ID: MTPAPA121
|
|||||||||||||
|
|
|
|
|
#4 (permalink) | |||||||||||||
|
Programmer
|
bump
__________________
Lovin My PS3
Playstation Network ID: MTPAPA121
|
|||||||||||||
|
|
|
|
|
#5 (permalink) | ||||||||||||
|
110100001101001111000
|
I was going to give you exactly what you needed until I read that. Insulting people who help you is not the way to get answers. Especially since your insult comes about from your own ignorance. Instead I'll give you the basic method for figuring out your problem:
http://www.google.com
__________________
|
||||||||||||
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|