| |
|
|
|
cURL Mailing List Monthly Index Single Mail
curl-library Mailing List Archives
Using LibCurlNet in a Windows Service
From: Anthony Desouza <Anthony_at_dxsolutions.co.uk>
Date: Tue, 1 Mar 2005 14:15:11 -0000
Hi,
I am trying to use LIBCURLNET (thank you Jeff Phillips) in a C# Windows
Everything builds and installs great, but when I try to access it from a
I have set up a reference to libcurlnet.dll in the service project and
I have also set my path to include a reference to /libcurlnet/bin/
I expected Libcurlnet.dll to work the same whether in a service project
I am a very new .NET developer. Is there any thing stupid I might be
Many thanks,
Anthony :)
Here is an example of my slightly modified EasyGet based on Jeff
using SeasideResearch;
using SeasideResearch.LibCurlNet;
class EasyGet
{
public static string strGetData;
public static string strErrorMessage;
public EasyGet()
{
EasyGet.strErrorMessage = "";
}
public EasyGet(string strURL)
{
try
{
EasyGet.strErrorMessage = "";
EasyGet.strGetData = "";
Easy oCurlOP = new Easy();
Easy.WriteFunction wf = new
oCurlOP.SetOpt(CURLoption.CURLOPT_URL, strURL);
oCurlOP.SetOpt(CURLoption.CURLOPT_WRITEFUNCTION,
oCurlOP.Perform();
oCurlOP.Cleanup();
Curl.GlobalCleanup();
}
catch(Exception ex)
{
EasyGet.strErrorMessage = ex.Message;
}
}
public string GetTransferData()
{
return EasyGet.strGetData;
}
public string GetTransferError()
{
return EasyGet.strErrorMessage;
}
public static Int32 OnWriteData(Byte[] buf, Int32 size,
{
EasyGet.strGetData =
return size * nmemb;
}
}
This is how I use this object, to query a PHP file that returns database
EasyGet oCurlOp = new EasyGet(PATH_IDMS + "getMachinePingData.php");
These mail archives are generated by hypermail. |
Page updated November 12, 2010.
web site info