• 调用聊天机器人 -小I机器人


     public static string sendMsg2(string msg)
           {
    
               try
               {    
                    msg = Uri.EscapeDataString( msg);
                    string sUrl = "http://i.xiaoi.com/robot/webrobot?data={%22sessionId%22:%228e52024188u65e13782%22,%22robotId%22:%22webbot%22,%22userId%22:%22b472189e640448c8927f3b982d945886%22,%22body%22:{%22content%22:%22"+msg+"%22},%22type%22:%22txt%22}";
                    string s = HttpHelper.HttpGet(sUrl);
                    string[] sAll =s.Split((char)1);//Trim((char)1).Trim();
                    int i = sAll.Length;
                    if (i > 1) {
                        i = i - 2;
                    }
                    if (i == 2)
                    {
                        i = 0;
                    }
                    s= sAll[i].Trim((char)1).Trim();
                    JToken  j = JToken.Parse(s);
                   // //{"robotId":"webbot","userId":"b472189e640448c8927f3b982d945886","sessionId":"8e52024100404449ba67f903c5e13782","type":"txt","body":{"fontStyle":0,"fontColor":0,"content":"今天是星期三
    今天是戊戌年五月廿一
    宜:嫁娶.祭祀.沐浴.扫舍.修饰垣墙.
    忌:行丧.安葬.
    
    ","emoticons":{}}}
                   return "" + j["body"]["content"];
    
               }
               catch(Exception ex)
               {
    
                   return "";
               }
    
    
           }
    

      

  • 相关阅读:
    DataGrid 应用合集
    [转]UBB C#完全版
    IE 7中的快捷键
    DataGrid 单击变色,鼠标经过变色 部分代码
    17种正则表达式
    单无格内强制换行
    图片上传,并自动生成缩略图!
    layout_weight学习心得
    android 手势
    java陷进一
  • 原文地址:https://www.cnblogs.com/wgscd/p/9263908.html
Copyright © 2020-2023  润新知