Sub lblHatsegKovez_Click()
Dim lbl As Label = Sender
lbl.Enabled = False
Dim cRec As Cursor
cRec = DBUtils.FnOpenRecSet(Starter.sql,"select * from AttachedFiles WHERE recid = " & lbl.Tag)
If cRec.RowCount > 0 Then
cRec.Position = 0
Try
Dim su As StringUtils
Dim b() As Byte = su.DecodeBase64(cRec.GetString("File64"))
Dim dir As String = File.DirDefaultExternal
Dim out As OutputStream =File.OpenOutput(dir, "tmpFileBinyan." & cRec.GetString("FileType") , False)
out.WriteBytes(b, 0, b.Length)
out.Close
'
Dim i As Intent
i.Initialize(i.ACTION_VIEW, "file://" & File.Combine(dir & "/", "tmpFileBinyan." & cRec.GetString("FileType")))
i.SetType("application/" & cRec.GetString("FileType") )
StartActivity(i)
Catch
Log(LastException)
End Try
End If
lbl.Enabled = True
End Sub