项目介绍

kuaidi100-api/.net-demo 是一个托管在 GitHub 上的开源项目,主要使用 C# 编写,目前获得 57 个 Star、4 次 Fork。

仓库全名
kuaidi100-api/.net-demo
Star 数
57
Fork 数
4

README 摘要

.net Project Introduce .net-demo 是由快递100官方提供的c# sdk,方便调试使用。 .net-demo 集成了实时查询、订阅推送、智能判断、云打印相关、电子面单相关、短信等接口。 Features 提供了快递100接口请求参数实体类、返回实体类。 提供测试类调试。 Getting started .net-demo使用和测试可参考test。 Use Junit Test Tips 如需获取账号信息(如 key、customer、secret),或免费试用100单,请访问API开放平台进行注册

完整内容见 GitHub 原始 README 或本页 。

常见问题

.net-demo 用什么语言开发?

主要使用 C# 编写,目前有 57 个 Star。

如何获取 .net-demo 的源码?

可以直接克隆仓库:git clone https://github.com/kuaidi100-api/.net-demo.git;安装与运行步骤见仓库 README。

.net-demo 最近还在维护吗?

仓库最近一次更新为 2025年12月30日,当前没有未关闭的 Issue;Star 数为 57,可作为社区活跃度的参考。

简要分析

热度分
122
价值分
41
活跃状态
活跃

语言占比

C#

README

.net Project

Introduce

.net-demo 是由快递100官方提供的c# sdk,方便调试使用。

.net-demo 集成了实时查询、订阅推送、智能判断、云打印相关、电子面单相关、短信等接口。

Features

  • 提供了快递100接口请求参数实体类、返回实体类。
  • 提供测试类调试。

Getting started

.net-demo使用和测试可参考test。

# git clone https://github.com/kuaidi100-api/.net-demo.git

Use Junit Test

class Program
{

    //快递100的基础账号信息,可以在这里获取 (需要填写完整才能测试)
    //https://api.kuaidi100.com/manager/v2/myinfo/enterprise
    private static KuaiDi100Config config = new KuaiDi100Config()
    {
        key = "",
        customer = "",
        secret = "",
        userid = "",
        siid = "",
        tid = "",
    };
    static void Main(string[] args)
    {
        // testQueryTrack();
        // testSubscribe();
        // testQueryTrackWithMap();
        // testSubscribeWithMap();
        // testPrintImg();
        // testPrintHtml();
        // testPrintCloud();
        // testSendSms();
        // testAutoNum();
        // testBOrderQuery();
        // testBOrder();
        // testBOrderCancel();
        // testInternationalShipment();
        // testCloudPrintCustom();
        // testCloudAttachment();
        // testCloudDevStatus();
        // testCloudPrintCommand();
        // testCloudPrintOld();
        // testCloudPrintParcelsBill();
        // testThirdPlatformStoreAuth();
        // testThirdPlatformCommitTask();
        // testThirdPlatformUploadNum();
        // testThirdPlatformAuth();
        // testThirdPlatBranchInfo();
        // testLabelCancel();
        // testOcr();
        // testBOrderOfficialQueryDetail();
        // testLabelOrder();
        // testLabelRepeatPrint();
        // testLabelCustomPrint();
        // testCOrder();
        // testCOrderCancel();
        // testCOrderQueryPrice();
        //testExpressReachable();
        //testBsamecityPrice();
        //testBsamecityOrder();
        //testBsamecityPrecancel();
        //testBsamecityAddfee();
        //testDeliveryTime();
        //testBackOrder();
        //testInterceptOrder();
        //testAddressResolution();
        //testIntAddressResolution();
    }

    /// <summary>
    /// 轨迹物流查询
    /// </summary>
    static void testQueryTrack()
    {
        var queryTrackParam = new QueryTrackParam()
        {
            com = "zhongtong",
            num = "7537****693697",
            phone = "15****98256"
        };

        QueryTrack.query(new QueryTrackReq()
        {
            customer = config.customer,
            sign = SignUtils.GetMD5(queryTrackParam.ToString() + config.key + config.customer),
            param = queryTrackParam
        });
    }

    /// <summary>
    /// 轨迹订阅
    /// </summary>
    static void testSubscribe()
    {
        var subscribeParameters = new SubscribeParameters()
        {
            phone = "159*****256",
            resultv2 = "1",
            callbackurl = "http://www.xxxx.com"
        };

        var subscribeParam = new SubscribeParam()
        {
            company = "zhongtong",
            number = "7537****693697",
            key = config.key,
            parameters = subscribeParameters
        };

        Subscribe.subscribe(new SubscribeReq()
        {
            schema = ApiInfoConstant.SUBSCRIBE_SCHEMA,
            param = subscribeParam,
        });
    }

    /// <summary>
    /// 地图轨迹物流查询
    /// </summary>
    static void testQueryTrackWithMap()
    {
        var queryTrackParam = new QueryTrackParam()
        {
            com = "zhongtong",
            num = "7537****693697",
            phone = "159****8256",
            from = "北京海淀区",
            to = "深圳南山区"
        };

        QueryTrackWithMap.query(new QueryTrackReq()
        {
            customer = config.customer,
            sign = SignUtils.GetMD5(queryTrackParam.ToString() + config.key + config.customer),
            param = queryTrackParam
        });
    }

    /// <summary>
    /// 地图轨迹订阅
    /// </summary>
    static void testSubscribeWithMap()
    {
        var subscribeParameters = new SubscribeParameters()
        {
            phone = "159****8256",
            resultv2 = "1",
            callbackurl = "http://www.xxxx.com"
        };

        var subscribeParam = new SubscribeParam()
        {
            company = "zhongtong",
            number = "7537****3697",
            key = config.key,
            parameters = subscribeParameters,
            from = "北京海淀区",
            to = "深圳南山区"
        };

        SubscribeWithMap.subscribe(new SubscribeReq()
        {
            schema = ApiInfoConstant.SUBSCRIBE_SCHEMA,
            param = subscribeParam,
        });
    }

     /// <summary>
    /// 电子面单V2打印接口
    /// </summary>
    static void testLabelOrder()
    {
        var orderParam = new OrderParam()
        {
            kuaidicom = "zhaijisong",
            sendMan = new ManInfo()
            {
                name = "张三",
                mobile = "15****98256",
                printAddr = "西藏日喀则市定日县珠穆朗玛峰",
            },
            recMan = new ManInfo()
            {
                name = "李四",
                mobile = "15****98256",
                printAddr = "西藏日喀则市定日县珠穆朗玛峰",
            },
            count = 1,
            siid = config.siid,
            tempId = "60f6c17c7c223700131d8bc3",
            printType = "CLOUD"
        };

        var timestamp = Date

提示:代码过长已自动截断

Tips

如需获取账号信息(如 key、customer、secret),或免费试用100单,请访问API开放平台进行注册

评论

暂无评论