Exemplo n.º 1
0
        public void ApiUsersGetID_Test()
        {
            var client = new DiscuzApiClient();

            var responseResult = client.UsersGetID("cyrano");

            Assert.AreEqual("\"443\"", responseResult);
        }
Exemplo n.º 2
0
        public static int GetAcnId(string username)
        {
            if (!ConfigGlobal_Arsenal.AcnSync)
            {
                return(-1);
            }

            var client = new DiscuzApiClient();

            var uid = client.UsersGetID(username);

            int acnUid;

            if (int.TryParse(uid.Replace("\"", ""), out acnUid))
            {
                return(acnUid);
            }
            return(0);
        }