40 lines
1.0 KiB
C#
40 lines
1.0 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using RestSharp;
|
|
using System.Net;
|
|
|
|
namespace CommonEntity
|
|
{
|
|
public class HiWei
|
|
{
|
|
public static string BaseUrl = "tvos.hw-iot.com.cn";
|
|
public void Login()
|
|
{
|
|
try
|
|
{
|
|
var client1 = new RestClient(BaseUrl);
|
|
var request1 = new RestRequest("/api/security/authenticate", Method.POST);
|
|
|
|
Dictionary<string, string> dic = new Dictionary<string, string>();
|
|
User us = new User();
|
|
us.username = "";
|
|
us.password = "";
|
|
us.oauth_id = 1;
|
|
request1.AddJsonBody(us);
|
|
|
|
var QQQ = client1.Execute(request1);
|
|
HttpStatusCode HHH = QQQ.StatusCode;
|
|
if (HHH == HttpStatusCode.Created||HHH==HttpStatusCode.OK)
|
|
{
|
|
}
|
|
}
|
|
catch (Exception)
|
|
{
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|