csharp 键入模式身份验证

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了csharp 键入模式身份验证相关的知识,希望对你有一定的参考价值。

public static string search(string dna, string id)
  {
      BiometricViewModel biometric = new BiometricViewModel();

      if (!string.IsNullOrWhiteSpace(dna) && !string.IsNullOrWhiteSpace(id))
      {
          TypingEnrolViewModel request = new TypingEnrolViewModel();
          request.samples = new List<string>();

          int studentId = Convert.ToInt32(id);
          biometric = GetBiometricDetailsByStudentId(studentId);
          request.user_id = biometric.TypingId;
          request.samples.Add(dna);

          string jsonObject = new JavaScriptSerializer().Serialize(request);



          HttpResponse<String> response = Unirest.post("https://api.keytrac.net/anytext/authenticate")
          .header("Authorization", "XXXXXXXXXX")
          .header("Content-Type", "application/json")
          .body(jsonObject)
          .asJson<String>();

          var result = response.Body;
          var results = JsonConvert.DeserializeObject<TypingViewModel>(response.Body);
          if (results.score < 50)
          {
              AbortRegistraction(studentId);
              LogEvent(studentId, "Authentication fails did not recognised the registed student typing pattern with a score of " + results.score);
              return "Authentication fails did not recognised the registed student typing pattern with a score of " + results.score;
          }

          return "worked";
      }
      else
      {
          return "Fail to student details and typing pattern";
      }
  }

以上是关于csharp 键入模式身份验证的主要内容,如果未能解决你的问题,请参考以下文章

csharp 使用Windows身份验证创建localhost sql连接

csharp ssh.net示例 - 基于密钥的身份验证,文件上载,Shell命令

csharp 这是用于非常高级别的客户端证书的MVC身份验证管道的示例

csharp 使用基本身份验证和代理的简单C#.NET 4.5 HTTPClient请求

SQLServer身份验证

混合模式联合身份验证和表单身份验证