基于C#的词典接口调用代码实例
接口描述:基于C#的词典接口调用代码实例
接口平台:聚合数据
using System;
using ;
using ;
using ;
using ;
using ;
using ;
using ;
using ;
//----------------------------------
// 成语词典调用示例代码- 聚合数据
// 在线接口文档:s/157
// 代码中JsonObject类下载地址:http://download./download/gcm3206021155665/7458439
//----------------------------------
namespace ConsoleAPI
{
class Program
{
static void Main(string[] args)
{
string appkey = "*******************"; //配置您申请的appkey
//
string url1 = "http://v./chengyu/query";
var parameters1 = new Dictionary<string, string>();
("word" , ""); //填写需要查询的汉字,UTF8 urlencode编码
("key", appkey);//你申请的key
("dtype" , ""); //返回数据的格式,xml或json,默认json
string result1 = sendPost(url1, parameters1, "get");
JsonObject newObj1 = new JsonObject(result1);
String errorCode1 = newObj1["error_code"].Value;
if (errorCode1 == "0")
{
("成功");
(newObj1);
}
else
{
//("失败");
基于c#的词典接口调用代码实例 来自淘豆网m.daumloan.com转载请标明出处.