cURL Mailing List Monthly Index Single Mail
curl-library Mailing List Archives
Curl through VB.NET almost working but..
From: Perkins, Christopher J <Christopher.J.Perkins_at_questdiagnostics.com>
Date: Thu, 21 Oct 2010 13:32:09 -0400
I have a program that I use in VBA that utilizes cURL to pull data from
a website, and it works fine. I am trying to get this working with
VB.NET (more specifically through ASP.NET using VB.NET). I have the
VB.NET bindings and I think they are working, but I am totally unclear
as to how to view the response back from the website. Below is my
function that is supposed to pull data from a specific website so that I
can parse it, again all these options are set in the VBA application and
it works perfectly. I think the areas I'm having trouble with are the
CURLOPT_WRITEFUNCTION and the CURLOPT_WRITEDATA. I have absolutely no
idea where the response text goes, but I can see that I'm getting over
14000 bytes so I know that it exists somewhere. In VBA the data was put
to a place called buffer.stringData, but this is not the case in VB.NET.
Any help would be much appreciated.
Public Function CurlTest(ByVal url As String, ByVal recipID As String,
ByVal RecipDOB As String, ByVal RecipDOI As String, ByVal RecipDOS As
Dim MySU As HttpServerUtility
Dim buf As New Buffer
Dim fp As StreamWriter
fp = New StreamWriter("c:\databases\test.txt")
Dim tempStr As String = ""
MySU = Server
Dim easy As Easy
easy = New Easy
' Set up write delegate
Dim wf As Easy.WriteFunction
wf = New Easy.WriteFunction(AddressOf OnWriteData)
' and the SSL delegate
Dim sf As Easy.SSLContextFunction
sf = New Easy.SSLContextFunction(AddressOf OnSSLContext)
Dim pf As Easy.ProgressFunction
pf = New Easy.ProgressFunction(AddressOf OnProgress)
' and the rest of the cURL options
'ENTER PROXY IP / PORT
easy.SetOpt(CURLoption.CURLOPT_POSTFIELDS, "RecipID=" &
recipID & "&RecipDOB=" & RecipDOB & "&RecipDOI=" & RecipDOI &
"&RecipDOS=" & RecipDOS & "&Submit=SUBMIT&UserID=UN&UserPW=PW")
UserPW=PW; LastTime=" & MySU.UrlEncode(CStr(Today() & " " & Now)) & ";
Catch ex As Exception
The contents of this message, together with any attachments, are
intended only for the use of the person(s) to which they are
addressed and may contain confidential and/or privileged
information. Further, any medical information herein is
confidential and protected by law. It is unlawful for unauthorized
persons to use, review, copy, disclose, or disseminate confidential
medical information. If you are not the intended recipient,
immediately advise the sender and delete this message and any
attachments. Any distribution, or copying of this message, or any
attachment, is prohibited.
These mail archives are generated by hypermail.
Page updated November 12, 2010.
web site info