|
There is actually code for commiting to the database, I just missed it out
'encrypt(password)
hashedBytes = shaHash.ComputeHash(encoder.GetBytes(txtPassword.Text & PSalt))
Dim PWhash As String = encoder.GetString(hashedBytes)
param = cmdString.Parameters.Add("?p_Password", MySqlDbType.VarChar)
param.Direction = ParameterDirection.Input
param.Value = PWhash
I have the thing working when i don't use the salt, but as soon as I add the salt it will never match the value stored in the table
|
|
|
|
|
boyindie wrote: hashedBytes = shaHash.ComputeHash(encoder.GetBytes(txtPassword.Text & PSalt))
Dim PWhash As String = encoder.GetString(hashedBytes)
You can't just take any byte sequence and decode it as UTF-8. Only a byte sequence that is created by encoding a string as UTF-8 can be safely decoded that way.
If you want to create a string representation of a byte sequence, use something like base64.
boyindie wrote: I have the thing working when i don't use the salt
Then you were just lucky to get byte sequences that happened to be possible to decode using the UTF-8 encoding without losing data.
---
single minded; short sighted; long gone;
|
|
|
|
|
I have now sorted this issue out I have the login now workin along with the salt
I am usin the method suggested by dave further back in the saga of this string
Just need to learn how to get sessions workin or a cookie, and i am sorted
|
|
|
|
|
Hi guys i want to built my own equalizer(sound control) using vb.net.so can anyone give me the codings to develop it.Thanks in advance..
Bala
|
|
|
|
|
bala_kathir wrote: so can anyone give me the codings to develop it.Thanks
If anyone gave you the code to do it, you wouldn't be developing it. If code is what you want Google for "VB.NET audio equalizer" and stuart hhunting. We're not going to hunt down code for you.
CP is here to help you write your own code. If you get to a point in your code where you're stuck, ask a specific question about it and we'll help.
|
|
|
|
|
How to disable back and forward button in browser?
Ashish K. Vyas
|
|
|
|
|
One of the best Method is Kill the session using Session.Abondon(); once user is logged out
Regards,
Satips.
Don't walk in front of me, I may not follow;
Don't walk behind me, I may not lead;
Walk beside me, and just be my friend. - Albert Camus
|
|
|
|
|
What the ...... ???? What does abandoning the session on the server-side have ANYTHING to do with the client-side's browser buttons??!?!?!?!?!
|
|
|
|
|
You can't disable the back button as far as I know, but you can add code in javascript so that when someone clicks back button, History + 1, so it will never go back.
Google that ![Smile | :)](https://www.codeproject.com/script/Forums/Images/smiley_smile.gif)
|
|
|
|
|
Hi,
Can you send me that code(java script)and let me know where i need to add that code.
thank you
Ashish K. Vyas
|
|
|
|
|
<script language="javascript"><br />
history.forward();<br />
</script>
|
|
|
|
|
i am having this error when i am about to delete a data row
inline with this is a message box saying:
object reference not set to an instance of an object. do you want to correct the value?
if i click yes, it will delete the row if no it will ignore the deletion
i've already checked all of my declarations and pretty sure that i've declared everything right.
here's my code:
Private Sub delCol_ButtonColumnClick(ByVal sender As Object, ByVal e As Leadit.ExtendedDataGrid.ButtonColumnEventArgs) Handles delCol.ButtonColumnClick
Dim row As Integer
Dim hourdiffBtn As Integer
Dim sBtn As DateTime
Dim eBtn As DateTime
Dim res As MsgBoxResult
row = Me.dtgCustomSched.CurrentRowIndex
res = MsgBox("Are you sure you want to delete the schedule on " + Me.dtgCustomSched.Item(row, 0), MsgBoxStyle.YesNo)
If res = MsgBoxResult.Yes Then
sBtn = Date.Parse(Me.dtgCustomSched.Item(row, 1))
eBtn = Date.Parse(Me.dtgCustomSched.Item(row, 2))
hourdiffBtn = getHrValue(sBtn, eBtn)
lastRowNumber = lastRowNumber - 1
Me.remainingHour2 = Me.remainingHour2 + hourdiffBtn
Me.txtLookUpHours.Text = remainingHour2.ToString
addSchedule.Table("ttcpcustomizedschedule").Rows.RemoveAt(row)
Else
Exit Sub
End If
End Sub
dtgcustomsched is the name of my datagrid
addsched is the name of the dataset
i made one of the datagrid cell as a customized button.. it already work fine with my other codes.. the problem only occur here
the error occurs on the line in bold.
also, this error only appears when i delete the last row on the datagrid, but if i delete anything rather than the last row everything works fine and no error is being detected
please help. thanx!
i am using vb.net 2002
|
|
|
|
|
cutequencher wrote: addSchedule.Table("ttcpcustomizedschedule").Rows.RemoveAt(row)
Most likely problem is that the Table call is returning null/nothing. Something sure is.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
maybe youre right but im confuse because when i click yes it continue to delete the row but with that error mesage. ive read some thread and says that its a bug on vb.net 2002 datagrid, but then i still need to resolve it, i just wonder if there is a way to disable the autocommit of datagrid? thanx!
|
|
|
|
|
Hi all,
Sorry to be a pain and this may just be a simple answer but I can't seem to find out how to do it.
I'm am currently developing some GIS software, I have the basic toolstrip above the map with all your tools eg Pan, zoom etc. The problem is that I can't seem to find how to have a toggle button on the toolstrip so when Pan is select, the button is pushed down and what ever was select pops back up.
This seems like a simple thing, it would be a bit strange if I had to do it in code.
Thanks for you help
Nathan
|
|
|
|
|
Do you have a sample of your code where you think it should be working?
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
I want to be able to force a system rightclick. Is there a way to do that?
|
|
|
|
|
yes. try to use the "keys" properties.
|
|
|
|
|
First, you're going to have to describe what you mean by a "system right-click".
|
|
|
|
|
I want to force a right-click so my program will bring up the contextmenu.
|
|
|
|
|
So call the Show method on the ContextMenu you want to show. You don't need to "force a right-click".
|
|
|
|
|
Hi
I have created a create user login function
which creates a random salt for each individual user and stores it into my mySQL database along with a salted hashed password
I enter all the data into my database thru a stored procedure
i keep on getting an odd error
That my procedure expected 7 parameters and only received 6
Altho my code is definetly passing 7 parameters accross to the database, on debuggin the parameter count is also equal to 7, it doesn't make sense, probably somthin stupid
can anyone see the problem
Cheers
Boy
my procedure is
CREATE DEFINER=`jshort`@`localhost` PROCEDURE `sp_myinsertUsers`(IN p_userName varchar(20), IN p_password varchar(200),IN p_salt varchar(200),IN p_firstName varchar(20), IN p_lastname varchar(200),IN p_phone integer(12), IN p_mail varchar(200))
BEGIN
INSERT INTO users(userName,Password,salt,user_firstName, user_lastName, user_phone,user_mail)VALUES(p_username, p_password,p_salt, p_firstname, p_lastname, p_phone, p_mail)
;
END
my code is as follows
Sub send_loginCreds(ByVal sender As Object, ByVal e As EventArgs)
Dim litErr As New LiteralControl
Dim shaHash As New System.Security.Cryptography.SHA384Managed()
Dim hashedBytes As Byte()
Dim encoder As New UTF8Encoding()
Dim data() As Byte
data = New Byte(6) {}
Dim rng As New RNGCryptoServiceProvider
rng.GetBytes(data)
Dim PSalt As String = Convert.ToBase64String(data)
'Create connection string to pass database, string holds login information to mySQL,
Dim connectionString As String
connectionString = "Server=localhost; ;database=ftp1;"
'Builds .net mysql connection and passes connection string into method
Dim connection As New MySqlConnection(connectionString)
'Create mySql command string for passing query or SPROC(Stored Procedure)
Dim cmdString As New MySqlCommand
'Set Command to equal mySql connection,t so can pass SQL query
cmdString.Connection = connection
Try
'Set command string to equal SPROC
cmdString.CommandText = "sp_myInsertusers"
'ONLY PLACE THIS IF SPROC, sets the command to a SPROC
cmdString.CommandType = CommandType.StoredProcedure
Dim param As New MySqlParameter
param = cmdString.Parameters.Add("?p_username", MySqlDbType.VarChar)
param.Direction = ParameterDirection.Input
param.Value = txtFirstName.Text
'encrypt(password)
hashedBytes = shaHash.ComputeHash(encoder.GetBytes(txtPassword.Text))
Dim PWhash As String = encoder.GetString(hashedBytes)
param = cmdString.Parameters.Add("?p_Password", MySqlDbType.VarChar)
param.Direction = ParameterDirection.Input
param.Value = PWhash
param = cmdString.Parameters.Add("?p_salt", MySqlDbType.VarChar)
param.Direction = ParameterDirection.Input
param.Value = PSalt
param = cmdString.Parameters.Add("?p_firstname", MySqlDbType.VarChar)
param.Direction = ParameterDirection.Input
param.Value = txtFirstName.Text
param = cmdString.Parameters.Add("?p_lastname", MySqlDbType.VarChar)
param.Direction = ParameterDirection.Input
param.Value = txtLastName.Text
param = cmdString.Parameters.Add("?p_phone", MySqlDbType.VarChar)
param.Direction = ParameterDirection.Input
param.Value = txtPhone.Text
param = cmdString.Parameters.Add("?p_mail", MySqlDbType.VarChar)
param.Direction = ParameterDirection.Input
param.Value = txtMail.Text
'Insert the records into the database
connection.Open()
cmdString.ExecuteNonQuery()
connection.Close()
Catch ex As Exception
litErr.Text = ex.Message
MsgBox(ex.Message)
End Try
Server.Transfer("userhome.aspx")
End Sub
|
|
|
|
|
boyindie wrote: 'encrypt(password)
hashedBytes = shaHash.ComputeHash(encoder.GetBytes(txtPassword.Text))
Dim PWhash As String = encoder.GetString(hashedBytes)
param = cmdString.Parameters.Add("?p_Password", MySqlDbType.VarChar)
param.Direction = ParameterDirection.Input
param.Value = PWhash
Might be the problem. In your stored proc it is p_password, and in the vb code is it p_Password. Not sure if it is case sensitive or not.
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
No,
I think it has somthin to do with my salt, as it was all working perfectly until i put the code for creating, converting and passing my salt value into database
![Frown | :(](https://codeproject.freetls.fastly.net/script/Forums/Images/smiley_frown.gif)
|
|
|
|
|
Is the string PSalt staying under 200 characters in length?
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|