Loading

Saving encrypted picture

Submitted by: 
Language: 
Visitors have accessed this post 10176 times.


this sample code explain on how to convert picture file into bytes and store to the database(ms access/sql server)....




Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.

Virus note: All files are scanned once-a-day by SourceCodester.com for viruses, but new viruses come out every day, so no prevention program can catch 100% of them.

FOR YOUR OWN SAFETY, PLEASE:

1. Re-scan downloaded files using your personal virus checker before using it.
2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

Comments

suspect777's picture

=)

I really need your help.. am using VB.Net 2005

I developing a restaurant software, which I have design the database for the daily transaction. On the daily transaction form.

I have textboxes, which I do type the qty, price and I use a button to send does items into a listview. Upon buying all the food I would like the listview items to be sent into a the transaction database.

Secondly, I would also I have a table within the database which stores information about workers of a company. How do I save an image into an Access database.

Thank you

suspect777's picture

Send mo nalang p're ung design para magawan natin ng code..

emond's picture

nice one brod, cap S , san chapter u?

suspect777's picture

STI Surigao tol, ikaw tol anong chapter?

capital S

emond's picture

San Pablo City Chapter

Long live and Happy Coding tol

Sir, Please Help Me. How Can I Count My Age? Like as my
Birth Date 01/01/1978 and Now date 14/01/2010.
Years=
Months=
Day=
I Need your help.

give me your email add pre, esend ko sayo ung source code....

sir suspect

suspect777's picture

year = DateDiff("yyyy", DTPicker1.Value, Date)
month = DateDiff("m", DTPicker1.Value, Date)
day = DateDiff("d", DTPicker1.Value, Date)

Sir,
Thank you u.

I Want
(15/01/2010-25/9/1977)

Year= 20 Years
Month=6 Months
Day=15 Days

Prog. Vb 6.0

My E-mail= moha_2314@yahoo.com

Thank you

i found some bug in my previous code so that i reupload it again...
^_^ mabuhay pinoy coders... hehehe

just try this one, i tested this source code and it works fine,
good luck, happy coding....

Dim strAge As String
Dim dteSubDate As Date
Dim intYr As Integer
Dim intMth As Integer
Dim intDay As Integer
Private Sub Command1_Click()
Dim x As Integer
strAge = ""
intYr = DateDiff("d", DTPicker1, Date)
intMth = DateDiff("d", DTPicker1, Date)
intDay = DateDiff("d", DTPicker1, Date)
intYr = intYr \ 365
dteSubDate = DateAdd("yyyy", intYr, DTPicker1)
If dteSubDate > Now Then
dteSubDate = DateAdd("yyyy", -1, dteSubDate)
wsDate = Format(dteSubDate, "mm/dd/yyyy")
intMth = DateDiff("m", wsDate, Now)
If wsDate > Now Then
intMth = intMth - 1
End If
intYr = intYr - 1

dteSubDate = DateAdd("m", intMth, dteSubDate)
wsDate = DateDiff("d", Now, dteSubDate)
If wsDate < 1 Then
wsDate = -1 * wsDate
End If
If intYr = 1 Then
strAge = intYr & " Year " & intMth & " Month"
End If
If intYr > 1 Then
strAge = intYr & " Years " & intMth & " Months"
End If
If wsDate = 1 Then
strAge = strAge & " " & wsDate & " Day"
End If
If wsDate > 1 Then
strAge = strAge & " " & wsDate & " Days"
End If
Else
wsDate = Format(dteSubDate, "mm/dd/yyyy")
intMth = DateDiff("m", wsDate, Now)
wsDate = DateAdd("m", intMth, wsDate)
If wsDate > Now Then
intMth = intMth - 1
End If
dteSubDate = DateAdd("m", intMth, dteSubDate)
wsDate = Format(dteSubDate, "mm/dd/yyyy")
intDay = DateDiff("d", dteSubDate, Now)
'If intDay < 1 Then
'intDay = -1 * intDay
'End If
' strAge = intYr & " " & intMth & " " & intDay

If intYr = 1 Then
strAge = intYr & " year"
End If

If intYr > 1 Then
strAge = intYr & " Years"
End If

If intMth = 1 Then
If intYr >= 1 Then
strAge = strAge & " " & intMth & " Month"
Else
strAge = intMth & " Month"
End If
End If

If intMth > 1 Then
If intYr >= 1 Then
strAge = strAge & " " & intMth & " Months"
Else
strAge = intMth & " Months"
End If
End If

If intDay = 1 Then
If intYr >= 1 Then
If intMth >= 1 Then
strAge = strAge & " " & intDay & " Day"
Else
strAge = strAge & " " & intDay & " Day"
End If
Else
If intMth >= 1 Then
strAge = strAge & " " & intDay & " Day"
Else
strAge = strAge & " " & intDay & " Day"
End If
End If
End If

If intDay > 1 Then
If intYr >= 1 Then
If intMth >= 1 Then
strAge = strAge & " " & intDay & " Days"
Else
strAge = strAge & " " & intDay & " Days"
End If
Else
If intMth >= 1 Then
strAge = strAge & " " & intDay & " Days"
Else
strAge = strAge & " " & intDay & " Days"
End If
End If
End If
'MsgBox (strAge)
End If
Text1 = strAge

End Sub

suspect777's picture

Private Sub Command1_Click()
Dim iyears As Integer
Dim tmonth As Integer
Dim Bmonth As Integer
'
iyears = DateDiff("yyyy", "01/01/" & DatePart("yyyy", DTPicker1.Value), "01/01/" & DatePart("yyyy", Now)) - 1
tmonth = DatePart("m", Now)
Bmonth = DatePart("m", DTPicker1.Value)
'
Select Case tmonth
Case Is > Bmonth
iyears = iyears + 1
Case Is = Bmonth
If DatePart("d", DTPicker1.Value) <= _
DatePart("d", Now) Then iyears = iyears + 1
MsgBox iyears
End Select
End Sub

Thank u sir

thanks po sa code n ibinigay nyo. it really helps us a lot

Can u plz send me the documentation of the Saving encrypted picture ??? thankxxx.....this is my e-mail add (typron_hotmail.com)

Thank Sir!!!..

Add new comment

Filtered HTML

  • You may insert videos with [video:URL]
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <asp>, <c>, <cpp>, <csharp>, <css>, <html4strict>, <java>, <javascript>, <mysql>, <php>, <python>, <sql>, <vb>, <vbnet>. The supported tag styles are: <foo>, [foo].
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.