本代码示例是基于C#的六派数据接口进行数据请求 API服务请求的代码示例,使用前你需要:
①:通过https://www.6api.net/api/caipiao/ 申请API服务
以下是完整代码示例:
class Response
{
public string statusCode;
}
static void Main(string[] args)
{
string method = "POST";
string url = "http://open.liupai.net/lottery/query";
Dictionary<string, string> param = new Dictionary<string, string>();
param.Add("appkey", "yourappsecret");
param.Add("cpid", "参数1");//彩票ID
param.Add("issueno", "参数2");//期号 不选默认是当前期
Dictionary<string, string> headers = null;
string result = api_send_request(method, url, param, headers);
if (result == "")
{
//返回内容异常,发送请求失败
Console.WriteLine("发送请求失败");
return;
}
Response res = new JavaScriptSerializer().Deserialize<Response>(result);
if (res.statusCode == "200") //有个别接口计费状态码为其他;请注意甄别
{
//状态码为200, 说明请求成功
Console.WriteLine(string.Format("请求成功: {0}", result));
}
else
{
//状态码非200, 说明请求失败
Console.WriteLine(string.Format("请求失败: {0}", result));
}
Console.ReadLine();
}
本代码示例是基于C#的六派数据接口进行数据请求 API服务请求的代码示例,使用前你需要:
①:通过https://www.6api.net/api/caipiao/ 申请API服务
以下是完整代码示例:
class Response
{
public string statusCode;
}
static void Main(string[] args)
{
string method = "POST";
string url = "http://open.liupai.net/lottery/history";
Dictionary<string, string> param = new Dictionary<string, string>();
param.Add("appkey", "yourappsecret");
param.Add("cpid", "参数1");//彩票ID
param.Add("issueno", "参数2");//期号 不选默认是当前期
param.Add("num", "参数3");//获取数量 最大20 默认10
param.Add("start", "参数4");//起始位置 默认0
Dictionary<string, string> headers = null;
string result = api_send_request(method, url, param, headers);
if (result == "")
{
//返回内容异常,发送请求失败
Console.WriteLine("发送请求失败");
return;
}
Response res = new JavaScriptSerializer().Deserialize<Response>(result);
if (res.statusCode == "200") //有个别接口计费状态码为其他;请注意甄别
{
//状态码为200, 说明请求成功
Console.WriteLine(string.Format("请求成功: {0}", result));
}
else
{
//状态码非200, 说明请求失败
Console.WriteLine(string.Format("请求失败: {0}", result));
}
本代码示例是基于C#的六派数据接口进行数据请求 API服务请求的代码示例,使用前你需要:
①:通过https://www.6api.net/api/caipiao/ 申请API服务
以下是完整代码示例:
class Response
{
public string statusCode;
}
static void Main(string[] args)
{
string method = "POST";
string url = "http://open.liupai.net/lottery/class";
Dictionary<string, string> param = new Dictionary<string, string>();
param.Add("appkey", "yourappsecret");
Dictionary<string, string> headers = null;
string result = api_send_request(method, url, param, headers);
if (result == "")
{
//返回内容异常,发送请求失败
Console.WriteLine("发送请求失败");
return;
}
Response res = new JavaScriptSerializer().Deserialize<Response>(result);
if (res.statusCode == "200") //有个别接口计费状态码为其他;请注意甄别
{
//状态码为200, 说明请求成功
Console.WriteLine(string.Format("请求成功: {0}", result));
}
else
{
//状态码非200, 说明请求失败
Console.WriteLine(string.Format("请求失败: {0}", result));
}
Console.ReadLine();
}
本代码示例是基于C#的六派数据接口进行数据请求 API服务请求的代码示例,使用前你需要:
①:通过https://www.6api.net/api/caipiao/ 申请API服务
以下是完整代码示例:
class Response
{
public string statusCode;
}
static void Main(string[] args)
{
string method = "POST";
string url = "http://open.liupai.net/lottery/winning";
Dictionary<string, string> param = new Dictionary<string, string>();
param.Add("appkey", "yourappsecret");
param.Add("cpid", "参数1");//彩票ID
param.Add("issueno", "参数2");//期号 默认为最新一期
param.Add("number", "参数3");//彩票号码 红球
param.Add("refernumber", "参数4");//彩票剩余号码 蓝球
param.Add("type", "参数5");//投注类型 1直选 2组三 3组六
Dictionary<string, string> headers = null;
string result = api_send_request(method, url, param, headers);
if (result == "")
{
//返回内容异常,发送请求失败
Console.WriteLine("发送请求失败");
return;
}
Response res = new JavaScriptSerializer().Deserialize<Response>(result);
if (res.statusCode == "200") //有个别接口计费状态码为其他;请注意甄别
{
//状态码为200, 说明请求成功
Console.WriteLine(string.Format("请求成功: {0}", result));
}
else
{
//状态码非200, 说明请求失败