• 大小: 385KB
    文件类型: .rar
    金币: 1
    下载: 0 次
    发布日期: 2021-05-06
  • 语言: C#
  • 标签:

资源简介

淘宝、天猫、京东 API接口样例,C# 非常实用,通常这些样例问别人要都是需要钱购买的! 亲自测试OK,这是在控制台上测试的。

资源截图

代码片段和文件信息

using EnvDTE;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Net;
using System.Security.Cryptography;
using System.Text;
using System.Web;
using Top.Api;
using Top.Api.Request;
using Top.Api.Response;
using RestSharp;
using System.Reflection;

namespace APITest
{
    class Program
    {
        static void Main(string[] args)
        {
            #region 天猫已能成功调用
            // appkey和appsecret是需要申请授权才能获取的,另外session也是需要按照api步骤进行授权获取的
            string url = “http://gw.api.taobao.com/router/rest“;
            string appkey = “12332632“;
            string appsecret = “afedeb633ee50687e8f81030f607297a“;
            ITopClient client = new DefaultTopClient(url appkey appsecret);
            TradesSoldGetRequest req = new TradesSoldGetRequest();
            req.Fields = “seller_nickbuyer_nicktitletypecreatedsidtidseller_ratebuyer_ratestatuspaymentdiscount_feeadjust_feepost_feetotal_feepay_timeend_timemodifiedconsign_timebuyer_obtain_point_feepoint_feereal_point_feereceived_paymentcommission_feepic_pathnum_iidnum_iidnumpricecod_feecod_statusshipping_typereceiver_namereceiver_statereceiver_cityreceiver_districtreceiver_addressreceiver_zipreceiver_mobilereceiver_phoneorders.titleorders.pic_pathorders.priceorders.numorders.iidorders.num_iidorders.sku_idorders.refund_statusorders.statusorders.oidorders.total_feeorders.paymentorders.discount_feeorders.adjust_feeorders.sku_properties_nameorders.item_meal_nameorders.buyer_rateorders.seller_rateorders.outer_iidorders.outer_sku_idorders.refund_idorders.seller_type“;
            DateTime dateTime = DateTime.Parse(“2016-09-10 00:00:00“);
            req.StartCreated = dateTime;
            DateTime dateTime1 = DateTime.Parse(“2016-10-10 00:00:00“);
            req.EndCreated = dateTime1;
            TradesSoldGetResponse response = client.Execute(req “7132a07fcb800301e46424a4d820812d7f8baf75fe75aea733534376“);
            #endregion

            #region 天气测试
            //1.根据城市查询天气
            //string url5 = “http://op.juhe.cn/onebox/weather/query“;

            //var parameters5 = new Dictionary();

            //parameters5.Add(“cityname“ “上海“); //要查询的城市,如:温州、上海、北京
            //parameters5.Add(“key“ “e89ea721dae9a2fc4c843d194c1823a2“);//你申请的key
            //parameters5.Add(“dtype“ “json“); //返回数据的格式xml或json,默认json

            //string result5 = sendPost(url5 parameters5 “get“);
            #endregion

            #region 京东

            #region 授权
            //string accurl = “https://auth.360buy.com/oauth/token“;
            //var para = new Dictionary();
            //para.Add(“client_id“ “AB12D1FD9DFCA3740902C74EB55227F2“);
            //para.Add(“client_secret“ “123c1cd52af64105b3603779f17e0062“);
            //para.Add(“grant_type“ “refresh_token“);
            //para.Add(“refresh_t

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----

     文件       3839  2016-11-19 11:52  APITest\APITest.csproj

     文件        189  2016-11-16 10:58  APITest\App.config

     文件      13312  2016-11-19 14:58  APITest\bin\Debug\APITest.exe

     文件        189  2016-11-16 10:58  APITest\bin\Debug\APITest.exe.config

     文件      19968  2016-11-19 14:58  APITest\bin\Debug\APITest.pdb

     文件      22696  2016-11-22 11:15  APITest\bin\Debug\APITest.vshost.exe

     文件        189  2016-11-16 10:58  APITest\bin\Debug\APITest.vshost.exe.config

     文件        490  2016-07-16 19:44  APITest\bin\Debug\APITest.vshost.exe.manifest

     文件     168960  2016-11-19 11:35  APITest\bin\Debug\RestSharp.dll

     文件     151199  2016-11-19 11:35  APITest\bin\Debug\RestSharp.xml

     文件    1073152  2016-11-17 21:24  APITest\bin\Debug\TopSdk.dll

     文件        554  2016-11-19 00:16  APITest\bin\Debug\topsdk.log

     文件      13824  2016-11-16 15:05  APITest\bin\Debug\WebApiContrib.CollectionJson.dll

     文件        947  2016-11-22 11:15  APITest\obj\Debug\APITest.csproj.FileListAbsolute.txt

     文件      20076  2016-11-19 11:52  APITest\obj\Debug\APITest.csprojResolveAssemblyReference.cache

     文件      13312  2016-11-19 14:58  APITest\obj\Debug\APITest.exe

     文件      19968  2016-11-19 14:58  APITest\obj\Debug\APITest.pdb

     文件       7788  2016-11-19 11:36  APITest\obj\Debug\DesignTimeResolveAssemblyReferencesInput.cache

     文件          0  2016-11-16 10:58  APITest\obj\Debug\TemporaryGeneratedFile_036C0B5B-1481-4323-8D20-8F5ADCB23D92.cs

     文件          0  2016-11-16 10:58  APITest\obj\Debug\TemporaryGeneratedFile_5937a670-0e60-4077-877b-f7221da3dda1.cs

     文件          0  2016-11-16 10:58  APITest\obj\Debug\TemporaryGeneratedFile_E7A71F73-0F8D-4B9B-B56E-8E70B10BC5D3.cs

     文件        229  2016-11-19 11:36  APITest\packages.config

     文件      17897  2016-11-22 11:21  APITest\Program.cs

     文件       1322  2016-11-16 10:58  APITest\Properties\AssemblyInfo.cs

     目录          0  2016-11-16 10:58  APITest\obj\Debug\TempPE

     目录          0  2016-11-19 11:52  APITest\bin\Debug

     目录          0  2016-11-19 11:52  APITest\obj\Debug

     目录          0  2016-11-16 10:58  APITest\bin

     目录          0  2016-11-16 10:58  APITest\obj

     目录          0  2016-11-16 10:58  APITest\Properties

............此处省略4个文件信息

评论

共有 条评论

相关资源