コード例 #1
0
 /// <summary>
 /// 验证后台接口
 /// </summary>
 /// <param name="userAccount"></param>
 /// <returns></returns>
 public WebApiAsyncResponse VerifyUserAccount(UserAccount userAccount)
 {
     _webApiAsyncParameter.Operation = string.Format("/api/Users/VerifyUserAccount");
     _webApiAsyncParameter.Parameter = userAccount;
     _webApiAsyncResponse            = _mtsWebAPIConsole.PostAsJsonAsync(_webApiAsyncParameter);
     return(_webApiAsyncResponse);
 }
コード例 #2
0
        static void Main(string[] args)
        {
            MTSWebAPIConsole     mtsWebAPIConsole     = new MTSWebAPIConsole();
            WebApiAsyncResponse  webApiAsyncResponse  = new WebApiAsyncResponse();
            WebApiAsyncParameter webApiAsyncParameter = new WebApiAsyncParameter();

            webApiAsyncParameter.Operation = string.Format("/api/Users/VerifyUserAccount");
            UserAccount userAccount = new UserAccount();

            userAccount.Account            = "ITECH_MTS_ADMIN";
            userAccount.PassWord           = "******";
            webApiAsyncParameter.Parameter = userAccount;
            webApiAsyncResponse            = mtsWebAPIConsole.PostAsJsonAsync(webApiAsyncParameter);
            Console.WriteLine(string.Format("返回状态 : {0}", webApiAsyncResponse.StatusCode));
            Console.WriteLine(string.Format("返回值 : {0}", webApiAsyncResponse.JsonReValue));
            Console.Read();
        }