易截截图软件、单文件、免安装、纯绿色、仅160KB

vb 保存图片到数据库

'读数据到二进制字段
Public Sub ReadfromBLOB(filed As ADODB.Field, Filen As String)
Dim DataFile As Integer, Fl As Long, Chunks As Integer
Dim Fragment As Integer, Chunk() As Byte, i As Integer
'传送块单位大小
Const ChunkSize As Integer = 16384
Dim MediaTemp As String
Dim lngOffset As Long
Dim lngTotalSize As Long
Dim strChunk As String
Dim MediaID As Long
On Error Resume Next
DataFile = FreeFile
Open Filen For Binary Access Write As DataFile
lngTotalSize = filed.ActualSize
Chunks = lngTotalSize \ ChunkSize
Fragment = lngTotalSize Mod ChunkSize
'ReDim Chunk(ChunkSize)
ReDim Chunk(Fragment)
Chunk() = filed.GetChunk(ChunkSize)
Put DataFile, , Chunk()
lngOffset = lngOffset + ChunkSize
Do While lngOffset < lngTotalSize
   Chunk() = filed.GetChunk(ChunkSize)
   Put DataFile, , Chunk()
   lngOffset = lngOffset + ChunkSize
Loop
Close DataFile
End Sub
'写数据到二进制字段
Public Sub SaveToBLOB(fieldBLOB As ADODB.Field, filename As String)
Dim DataFile As Integer, Fl As Long, Chunks As Integer
Dim Fragment As Integer, Chunk() As Byte, i As Integer
'传送块单位大小
Const ChunkSize As Integer = 16384
Dim MediaTemp As String
Dim lngOffset As Long
Dim lngTotalSize As Long
Dim strChunk As String
Dim MediaID As Long
DataFile = FreeFile
Open filename For Binary Access Read As DataFile
    Fl = LOF(DataFile)    ' 文件中数据长度
    If Fl = 0 Then
       Close DataFile
    Else
    Chunks = Fl \ ChunkSize
    Fragment = Fl Mod ChunkSize
    'If Chunks <= 0 Then Chunks = 1
    ReDim Chunk(Fragment)
    Get DataFile, , Chunk()
    fieldBLOB.AppendChunk Chunk()
    ReDim Chunk(ChunkSize)
   
    For i = 1 To Chunks
     Get DataFile, , Chunk()
  &n


相关文档:

如何让一个VB窗口总是处于各窗口的最上层

代码如下:
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As
Long, ByVal hWndInsertAfter As Long,& _ 
         ByVal X As Long, ByVal Y As
Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long & _
 &n ......

c# 验证码组件 可vb,asp,net调用

      今天公司要求用C#写个验证码组件,让asp可以调用,在网上找了一堆资料,终于给我给搞出来了,因为本人第一次写组件,也是第一次发表文章,所有可能说的不是很好,大家请见谅。
      csdn上有这么篇文章,想学习写组件的可以去看看:http://blog.csdn.net/KimmKi ......

VB实现全窗体移动

Private Declare Function ReleaseCapture Lib "user32" () As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const WM_NCLBUTTONDOWN = &HA1
Private Const HTCAPTION = 2
Priva ......

VB复制文件夹的方法(非FSO)

http://www.webuc.net/ddf3/archive/2005/08/25/6142.aspx
不用FSO的复制文件夹得方法?
用API函数 SHFileOperation
以下是使用SHFileOperation删除复制移动文件的例子,可以复制文件夹
Private Type SHFILEOPSTRUCT
  hwnd As Long
  wFunc As Long
  pfrom As String
  pTo As String
  fFlags As ......

VB中利用DataBase巧妙设置DataReport中的动态SQL

    近日分析一VB做的报表,由于对VB只是了解,谈不上熟练,不过对其水晶报表倒有点认识,之前也做过三两个小的报表 ,加之对PB中的报表了解非常熟悉,当时信心蛮大的。
    先是看了DataReport,用于绘制报表格式。再来看DataEnvironment,用于定义获取的数据列。将DataReport与DataEnviro ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号