Click here to Skip to main content
15,907,328 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi i have make one vb6 application.now i want to post some data .so please tell me how can i do that
Posted
Comments
CodingLover 11-Oct-12 1:18am    
Did you try anything? If so please show us it here, we'll help you to improve it and solve your question.
Dharmessh12 11-Oct-12 3:07am    
when i have used chilket.dll at time i have do following....
and it's working but if i d'nt want to used this dll then what i have do for that..
if i wil use your soluction thaen tell what i have to do in my project


Dim req As New ChilkatHttpRequest
Dim http As New ChilkatHttp

Dim domain As String
Dim port As Long
Dim ssl As Long
domain = "192.168.0.18"
port = 8080
ssl = 0
Dim resp As ChilkatHttpResponse


req.UsePost
req.Path = "Educe/Receive_InsertDateFromPunchingMachine"

Set resp = http.SynchronousRequest(domain, port, ssl, req)
MsgBox "Success"
Set resp = http.SynchronousRequest(domain, port, ssl, req)
MsgBox "Success"
Dharmessh12 11-Oct-12 2:03am    
ya i have try using chilkat.dll but chilkat.dll is required license.so i want another way for that.
thanks for giving solution.i will try that
Dharmessh12 11-Oct-12 2:45am    
what i have to do for this all below method for my project
InternetOpen("test_post_data", 0, vbNullString, vbNullString, 0),
InternetConnect(__a, "domainname.com", 80, "", "", 3, 0, 0)
HttpOpenRequest(__b, "POST", "/test.aspx", "HTTP/1.0", vbNullString, 0, -2147483648#, 0)

1 solution

Dim __a As Long, __b As Long, __c As Long
Dim bRet As Boolean, lpszPostData As String, sHeader As String, sBuff As String * 1024

__a = InternetOpen("test_post_data", 0, vbNullString, vbNullString, 0)
If __a <> 0 Then
__b = InternetConnect(__a, "domainname.com", 80, "", "", 3, 0, 0)

If __b <> 0 Then
__c = HttpOpenRequest(__b, "POST", "/test.aspx", "HTTP/1.0", vbNullString, 0, -2147483648#, 0)

If __c <> 0 Then
sHeader = "Content-Type: application/x-www-form-urlencoded" & vbCrLf
bRet = HttpAddRequestHeaders(__c, sHeader, Len(sHeader), -1610612736)

lpszPostData = "param1=" & param1 & "¶m2=" & param2
bRet = HttpSendRequest(__c, vbNullString, 0, lpszPostData, Len(lpszPostData))

If bRet Then
If (HttpQueryInfo(__c, 5, sBuff, 1024, 0) = 1) Then
'You can get response of page in [sBuff]
End If
End If

bRet = InternetCloseHandle(__c)
End If
bRet = InternetCloseHandle(__b)
End If
bRet = InternetCloseHandle(__a)
End If


' Yuo must to include api in your module also...
 
Share this answer
 
Comments
Dharmessh12 25-Oct-12 5:38am    
hi i have do but .but i d'nt know how to add api in my module .
thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900