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:\Windows\system32\services.exe"
fileToHash(1) = "C:\Windows\system32\lsass.exe"
fileToHash(2) = "C:\Windows\system32\svchost.exe"
fileToHash(3) = "C:\Windows\system32\alg.exe"
fileToHash(4) = "C:\Windows\system32\winlogon.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))
'MsgBox(fileMD5)
dbInsert(fileMD5, fileToHash(i), i)
HashCalcProgressBar.Value += 20
Else
MsgBox("File Not Found")
End If
End If
Next
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)
DbConnection()
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
ds.Tables("values").Rows().Add(dsnewrow)
da.Fill(ds)
da.Update(ds, "values")
con.Close()
End Sub