using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;
using System.IO;
using Xfrog.Net;
using System.Diagnostics;
using System.Web;
//----------------------------------
// 图像识别调用示例代码 - 聚合数据
// 在线接口文档:http://www.juhe.cn/docs/117
// 代码中JsonObject类下载地址:http://download.csdn.net/download/gcm3206021155665/7458439
//----------------------------------
namespace ConsoleAPI
{
class Program
{
static void Main(string[] args)
{
string appkey = "*******************"; //配置您申请的appkey
//1.图像上传
string url1 = "http://japi.juhe.cn/image_recognition/upload";
var parameters1 = new Dictionary();
parameters1.Add("file" , ""); //上传的单张图片
parameters1.Add("key", appkey);//你申请的key
parameters1.Add("pname" , ""); //包名
string result1 = sendPost(url1, parameters1, "post");
JsonObject newObj1 = new JsonObject(result1);
String errorCode1 = newObj1["error_code"].Value;
if (errorCode1 == "0")
{
Debug.WriteLine("成功");
Debug.WriteLine(newObj1);
}
else
{
//Debug.WriteLine("失败");
Debug.WriteLine(newObj1["error_code"].Value+":"+newObj1["reason"].Value);
}
//2.查寻上传图像信息
string url2 = "http://japi.juhe.cn/image_recognition/fi