|
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
|
|
|
|
|
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
|
|
|
|
|
Are any of the parameter values an empty string??
|
|
|
|
|
Discovered problem, the actual value of my salt field in database wasn't long nuff for some reason had it only set to 50.
Been at this too long i thinks, although i now have my page working
Cheers People
|
|
|
|
|
Glad it sounds like you got it figured out
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
well no1 whose got a girlfriend is goin to be hacking my passwords anytime soon
|
|
|
|
|
I noticed you were using SHA384 , and that should be plenty sufficient for some time
"Any sort of work in VB6 is bound to provide several WTF moments." - Christian Graus
|
|
|
|
|
I'm working on my first vb.Net project I have a field that is not required, but is numeric. If the user leaves the field blank I get the following error, when I try to use it set a value in my object.
InvalidCastException: Cast from string "" to type 'Integer' is not valid.]
Here is the code.
MyShelled.KC = Me.txtKC.Text
Here is the object's property
Public WriteOnly Property KC() As Integer
Set(ByVal NewVal As Integer)
MyKC = NewVal
End Set
End Property
I've tried to create overloaded properties but I get the following compile error.
c:\inetpub\wwwroot\Shelling\clsZebra.vb(228): 'Public Overloads WriteOnly Property KC() As Integer' and 'Public Overloads WriteOnly Property KC() As String' cannot overload each other because they differ only by return types.
I'd like to handle this in my class but I'm not sure how to go about. Any direction would be great.
Thanks
Travis
|
|
|
|
|
If Not IsNothing(Me.txtKC.Text) AndAlso me.txtKC.text.trim <> String.Empty Then
MyShelled.KC = Me.txtKC.Text
End If
|
|
|
|
|
FYI, to handle in your class, you would need to define your property as an object so that it can accept different datatypes like strings and numbers, etc. then filter out anything you don't want to allow like empty strings, etc.
|
|
|
|
|
mymacryan wrote: MyShelled.KC = Me.txtKC.Text
This happens because VB is weakly typed ( aka sucks ). You need to set a default value if the string is empty. One way to do this is to pretend it's strongly typed and use int.TryParse to see if you get an int out of it, and otherwise set a default. This has the advantage of not assuming your presentation layer has only allowed numbers to be entered.
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 )
|
|
|
|
|
Christian,
I'm curious...
he has his property set as type 'integer' you can set a default value on that where you send an empty string to the property and the default will be applied instead of throwing an exception?
how do you do that?
|
|
|
|
|
|
When i run my application, backgroundworker starts. Then i stop it by exiting the sub and when i try to start it again, it says backgroundWorker is busy.
How can i reset the Background Worker so it can start again? (.CancelAsync doesent work)
|
|
|
|
|
set this property to true when you first setup the variable for the backgroundworker then the cancel will work
Worker.WorkerSupportsCancellation
|
|
|
|
|
i forgot to mention it was already set to true. It stops fine, it's only when i want to restart that it gives me an exception.
here is part of the code: (cancellation support is already set to true)
Private Sub stopdwlbut_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles stopdwlbut.Click
Me.bgworker1.CancelAsync()
End Sub
Private Sub bgworker1_DoWork(ByVal sender As Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles bgworker1.DoWork
For Y = 1 To numsites
'does what i want it to do
If Me.bgworker1.CancellationPending Then
e.Cancel = True
CType(bgworker1, BackgroundWorker).ReportProgress(0)
Exit Do
End If
End Sub
Private Sub bgworker1_ProgressChanged(ByVal sender As Object, ByVal e As System.ComponentModel.ProgressChangedEventArgs) Handles bgworker1.ProgressChanged
If e.ProgressPercentage = 0 Then
Downloadbut.Enabled = True
stopdwlbut.Enabled = False
MsgBox("download canceled")
Else
'does something else
End If
End Sub
|
|
|
|
|
then reset it...
worker.dispose
worker = nothing
worker = new backgroundworker
|
|
|
|
|
cool, thx alot for the quick reply, it finally worked
|
|
|
|
|
Once a thread is stopped, it cannot be restarted. You have to destroy it and create a new one.
|
|
|
|
|
Hello
I have 2 combo boxes that are bound to 2 different binding sources. The binding source are bound to the same table adapter.
The customer want to remove an orderID number from one of the combo boxes, the other combo box should still have the orderID number. (remove from one, but leave the other)
I have tried to remove the orderID number for the binding source. But this removes the orderID from both combo boxes.
If i remove the orderID from the combo box itself then I have to remove the binding itself. Which leave no orderIDs in the combo box itself. So that doesn't work either. This is my code for removing it from the bindingsource.
Dim index = Me.bsPendingOrders.Find("OrderID", Me.cboPendingOrders.SelectedValue)<br />
If Not (index = -1) Then<br />
Me.bsPendingOrders.RemoveAt(index)<br />
End If
Many thanks for any suggestions.
|
|
|
|
|
You need to create two identical binding sources, so when you remove from one, the other one is unaffected.
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 )
|
|
|
|
|
Hey,
I'm trying to save a file with the SaveAs function under the Word.Document... However, if I have a file of the same name, it simply overwrites without giving me a prompt to do so.. Is there any way around this? I checked the list of parameters, and none of them give like, a boolean for 'SaveOverride' or whatever. Thanks.
---
reegan41
|
|
|
|
|
According to the SaveAs help documentation the default behaviour is to overwrite without prompting. What you can do is test to see if the file your are going to save as already exists, and then do something to select another name. In the code example below, if the file "c:\test.doc" exists the while loop will try for "c:\test_1.doc". If that file exists, it will then try for "c:\test_2.doc" and so on.
<br />
Dim I As Long<br />
Dim SaveAsFileName As String<br />
Dim NewSaveAsFileName As String<br />
<br />
SaveAsFileName = "c:\Test.doc"<br />
NewSaveAsFileName = SaveAsFileName<br />
<br />
While Dir(NewSaveAsFileName, vbNormal) <> ""<br />
<br />
I = I + 1<br />
NewSaveAsFileName = Left(SaveAsFileName, Len(SaveAsFileName) - 4) & "_" & i & _<br />
Right(SaveAsFileName, 4)<br />
<br />
Wend<br />
|
|
|
|
|
Hi There,
My Propblem is quite straight forward, but after searching for an answer, I am now more confused than before.
When using reference types as arguments, should the Argument be declared By Value (Byval) or By Refrence (Byref), to obtain the best performance.
ie:
Private Sub DoStuff (ByVal Connection as SQLConnection)
or
Private Sub DoStuff (ByRef Connection as SQLConnection)
On the one hand it feels like ByRef would be better, since the address of the instance would be used, rather than a copy of the instance. But then I read an article that states VB.net when using ByRef actually creates a copy of the instance, uses it as the argument, then copies it back to the original instance. But Byval only Boxes it once, therefore Byval would be faster.
Can anyone give me some clarity on this?
Thanks in advance
Rob
|
|
|
|