vb的inet用来post数据,post上传图片怎么处理呢?我这个代码错误在哪里?
vb的inet用来post数据,post上传图片怎么处理呢?我这个代码错误在哪里?
Dim PostDate As String
Dim b() As Byte
Dim rightt1 As Boolean
Open "C:\Users\Administrator\Desktop\搜狗截图_2013-06-04_17-44-35.png" For Binary As #1
ReDim b(LOF(1) - 1) '定义数组长度
Get #1, , b()
Close #1
For i = 0 To UBound(b())
bn = bn & b(i)
Next
MsgBox bn
If Inet2.StillExecuting = True Then Exit Sub
PostDate = "Content-Disposition=form-data&name=file&filename=3.png&Content-Type=image/x-png " & bn
'MsgBox PostDate
Inet2.Execute "http://localhost/upload_file.php", "POST", PostDate, "Referer: http://localhost/bd.html" & vbCrLf & "Content-Type: multipart/form-data; boundary=---------------------------7dd2f7352a0f78" & vbCrLf & "Content-Length=8451" ' & vbCrLf & "Accept-Encoding:BASE64"
VB
inet
--------------------编程问答--------------------
恐怕,要把上传的文件转为字节(byte),再上传吧?
补充:VB , 网络编程