|
-
Nov 2nd, 2005, 12:44 AM
#1
Thread Starter
Hyperactive Member
algorithms
how would i take text from a textbox, put it through a agrorythem and then write the agrorythem result to the registry?
Last edited by cdubb07; Nov 2nd, 2005 at 09:00 AM.
"Anybody can get angry or sad and frown but it takes a person with character to smile when times are hard."
-
Nov 2nd, 2005, 01:29 AM
#2
Re: agrorythems
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?
-
Nov 2nd, 2005, 08:59 AM
#3
Thread Starter
Hyperactive Member
Re: agrorythems
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.
"Anybody can get angry or sad and frown but it takes a person with character to smile when times are hard."
-
Nov 2nd, 2005, 09:19 AM
#4
Re: algorithms
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)
-
Nov 2nd, 2005, 09:20 AM
#5
Re: agrorythems
 Originally Posted by jmcilhinney
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?
Angry music? Is agrorythm a band? I can't google it.
-
Nov 2nd, 2005, 05:10 PM
#6
Re: agrorythems
 Originally Posted by mendhak
Angry music? Is agrorythm a band? I can't google it. 
"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)
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.
-
Nov 2nd, 2005, 05:51 PM
#7
Thread Starter
Hyperactive Member
Re: algorithms
how would i go about enabling md5?
"Anybody can get angry or sad and frown but it takes a person with character to smile when times are hard."
-
Nov 2nd, 2005, 06:43 PM
#8
Re: algorithms
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)
Note that I've never done that before myself. I just looked it up in the help and used a bit of deduction.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|