webapi接口:自己测试的小玩意验证接口登录原创
金蝶云社区-dzz
dzz
5人赞赏了该文章 257次浏览 未经作者许可,禁止转载编辑于2024年03月05日 09:30:59

image.png


using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

using Kingdee.BOS.WebApi.Client;

using Newtonsoft.Json.Linq;



namespace ConsoleApp1

{


    class Program

    {

        static void Main(string[] args)

        {

            Console.WriteLine("请输入账号:");

            var name = Console.ReadLine();

            Console.WriteLine("请输入密码:");

            var password = Console.ReadLine();

            K3CloudApiClient client = new K3CloudApiClient("http://175.6.208.227:7879/K3Cloud/Kingdee.BOS.WebApi.ServicesStub.AuthService.ValidateUser.common.kdsvc");

            var loginResult = client.ValidateLogin("65716c0b42fc36", name, password, 2052);

            Console.Write(JObject.Parse(loginResult)["KDSVCSessionId"]);

            var pp = Console.ReadLine();

            //var resultType = JObject.Parse(loginResult)["LoginResultType"];

            //int resultTypetwo = resultType.Value<int>();


            //if (resultTypetwo == 1)

            //{


            //    Console.WriteLine("登陆成功!"+ resultType

            //        );

            //    Console.Write(JObject.Parse(loginResult));

            //}

            //else if(resultTypetwo != 1)

            //{

            //    Console.Write("登入失败");

            //}

        }

    }

}


赞 5