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
相关文档:
http://topic.csdn.net/t/20060401/19/4656391.html
Private Declare Function GetCurrentProcess Lib "kernel32" () As Long
Private Declare Function SetPriorityClass Lib "kernel32" (ByVal hProcess As Long, ByVal dwPriorityClass As Long) As Long
Const IDLE_PRIORITY_CLASS = &H40 '新进程应该有非常低的 ......
今天公司要求用C#写个验证码组件,让asp可以调用,在网上找了一堆资料,终于给我给搞出来了,因为本人第一次写组件,也是第一次发表文章,所有可能说的不是很好,大家请见谅。
csdn上有这么篇文章,想学习写组件的可以去看看:http://blog.csdn.net/KimmKi ......
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 ......
IDE:Visual Web Developer 2008 Express Edition
数据库:Access 2007
到http://www.asp.net/ajax/downloads/下载AJAX Control Toolkit,将AjaxControlToolkit.dll拷贝到项目的bin目录下,在工具栏中引入。
WebService的代码:(aaa.asmx)
Public Function GetCompletionList(ByVal prefixText As String, ByVal coun ......