How to associate a timer to my function..? - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

How to associate a timer to my function..?

metagothmetagoth Posts: 4Member
I am facing another issue. I want to associate a timer to my function. Actually what i am doing is that i am tryin to store certain values in a database. A function is such that it calculates 5 values and stores them in a database. While storing them in the database it displays them in a textbox on the form. Now i want to display them one by one which it does. But it does it so fast that i can only see the last value that it enters in the database inside the textbox.

Can i make it show all the values slowly one by one.

Can anybody suggest me how to do so. I googled a lot but could find a particular answer.
thnx in advance friends..
Sub CreateHash()
HashCalcProgressBar.Minimum = 0
HashCalcProgressBar.Maximum = 100
HashCalcProgressBar.Value = 0
Dim fileMD5 As String
Dim i As Integer
fileToHash(0) = "C:Windowssystem32services.exe"
fileToHash(1) = "C:Windowssystem32lsass.exe"
fileToHash(2) = "C:Windowssystem32svchost.exe"
fileToHash(3) = "C:Windowssystem32alg.exe"
fileToHash(4) = "C:Windowssystem32winlogon.exe"
For i = 0 To 4
If HashCalcProgressBar.Value < 100 Then
If My.Computer.FileSystem.FileExists(fileToHash(i)) Then
'MsgBox("The File " + fileToHash(i) + " found in System Folder")
fileMD5 = GenerateFileMD5(fileToHash(i))
dbInsert(fileMD5, fileToHash(i), i)
HashCalcProgressBar.Value += 20
MsgBox("File Not Found")
End If
End If
i = i + 1
End Sub

Private Sub dbInsert(ByVal strfile As String, ByVal hashoffile As String, ByVal p As Integer)
'parameter to the above function (ByVal strfile As String)

cmd = "select * from hashtable"
da = New OleDb.OleDbDataAdapter(cmd, con)
da.Fill(ds, "values")
maxrows = ds.Tables("values").Rows.Count
TextBox1.Text = p + 1
TextBox2.Text = hashoffile
TextBox3.Text = strfile
Dim cb As New OleDb.OleDbCommandBuilder(da)
Dim dsnewrow As DataRow
dsnewrow = ds.Tables("values").NewRow()
dsnewrow.Item("p_id") = TextBox1.Text
dsnewrow.Item("process_name") = TextBox2.Text
dsnewrow.Item("hash_value") = TextBox3.Text
da.Update(ds, "values")
End Sub
Sign In or Register to comment.