how would i take text from a textbox, put it through a agrorythem and then write the agrorythem result to the registry?
Printable View
how would i take text from a textbox, put it through a agrorythem and then write the agrorythem result to the registry?
Are you talking about angry music, or do you mean an algorithm? An algorithm is just a method of performing some calculation, so you need to implement it yourself in code. That means you would pass the Text property of the TextBox to a function you have written that implements the algorithm and then write the result to the registry. I KNOW you know how to write to the registry, right?
lol, my bad, algrorithm, i'm using it to encrypt my password, i think i got it but can you give me a example, and yes i do know how to write to the registry lol.
Here is an example from freevbcode.com,
VB Code:
Pubilc Function WriteToRegistry(ByVal _ ParentKeyHive As RegistryHive, _ ByVal SubKeyName As String, _ ByVal ValueName As String, _ ByVal Value As Object) As Boolean 'DEMO USAGE 'Dim bAns As Boolean 'bAns = WriteToRegistry(RegistryHive.LocalMachine, "SOFTWARE\MyCompany\MyProgram\", "ProgramHasRunBefore", "Y") 'Debug.WriteLine("Registry Write Successful: " & bAns) Dim objSubKey As RegistryKey Dim sException As String Dim objParentKey As RegistryKey Dim bAns As Boolean Try Select Case ParentKeyHive Case RegistryHive.ClassesRoot objParentKey = Registry.ClassesRoot Case RegistryHive.CurrentConfig objParentKey = Registry.CurrentConfig Case RegistryHive.CurrentUser objParentKey = Registry.CurrentUser Case RegistryHive.DynData objParentKey = Registry.DynData Case RegistryHive.LocalMachine objParentKey = Registry.LocalMachine Case RegistryHive.PerformanceData objParentKey = Registry.PerformanceData Case RegistryHive.Users objParentKey = Registry.Users End Select 'Open objSubKey = objParentKey.OpenSubKey(SubKeyName, True) 'create if doesn't exist If objSubKey Is Nothing Then objSubKey = objParentKey.CreateSubKey(SubKeyName) End If objSubKey.SetValue(ValueName, Value) bAns = True Catch ex As Exception bAns = False End Try Return True End Function
(Imports Microsoft.Win32)
Angry music? Is agrorythm a band? I can't google it. :(Quote:
Originally Posted by jmcilhinney
"Agro" is an Australian colloquialism, short for "aggravation" or "aggravated", and "rythem" is almost "rhythm", so together they could be the new term for some aussie heavy metal. (Sorry metal fans but some of it sounds angry to me)Quote:
Originally Posted by mendhak
cdubb07, which algorithm are you using to encrypt your passwords? .NET has in-built support for MD5 and SHA1, so a help/MSDN search for either of those terms should give you some results. Note that these are hasing algorithms so the encryption is one-way, i.e. the hash value can never be used to re-create the original password. They are generally used to encrypt a password when it is created, then on subsequent logins the password provided is hashed using the same algorithm and compared to the stored value. That way it is safe to store the hashed password in an unsecure location, like a text file.
how would i go about enabling md5?
Note that I've never done that before myself. I just looked it up in the help and used a bit of deduction.VB Code:
Dim unencryptedPassword As String 'Put actual password here. Dim unencryptedBytes As Byte() = System.Text.Encoding.Unicode.GetBytes(unencryptedPassword) Dim md5Encrypter As New System.Security.Cryptography.MD5CryptoServiceProvider Dim encryptedBytes As Byte() = md5Encrypter.ComputeHash(unencryptedBytes) Dim encryptedPassword As String = System.Text.Encoding.Unicode.GetString(encryptedBytes)