2.2. Login with C#

You can download the C# package here.

Example of login with C#

    [DllImportAttribute("idclib.dll")]
        public static extern int GetAccessData(int idcgameid, string idctk, string idcuuid, ref int iduser, 
          [Out] StringBuilder usercrc,
          [Out] StringBuilder language, 
          [Out] StringBuilder country,
          [Out] StringBuilder currency);

    [DllImportAttribute("idclib.dll")]
        public static extern int GetUserProfileInfo(int userid, string secret,
          [Out] StringBuilder nick, [Out] StringBuilder email,
          [Out] StringBuilder status, [Out] StringBuilder avatar,
          [Out] StringBuilder custom, [Out] StringBuilder language,
          [Out] StringBuilder country, [Out] StringBuilder currency);

        private void idcfunctions()
        {
            int result = 0;

    //getAcessData params
            int userid = 0;
            int gameid = 1;
            StringBuilder usercrcaux = new StringBuilder(256);
            StringBuilder countryaux = new StringBuilder(3);
            StringBuilder languageaux = new StringBuilder(3);
            StringBuilder currencyaux = new StringBuilder(3);
            string usercrc;
            string country;
            string language;
            string currency;

    //getUserProfileInfo params
        //int gameid; //already defined in getAccessData params
            string token = "4a0a7b6e8f7775f84883093e1028a0a2";
            string uuid = "6022DAAE-03F7-11E9-BB88-E86A6485A3C7";
            StringBuilder nickaux = new StringBuilder(80);
            StringBuilder emailaux = new StringBuilder(320);
            StringBuilder statusaux = new StringBuilder(1024);
            StringBuilder avataraux = new StringBuilder(1024);
            StringBuilder customaux = new StringBuilder(1024);
            string nick;
            string email;
            string status;
            string avatar;
            string custom;

            result = getAccessData(gameid, token, uuid, ref userid, usercrcaux, countryaux, languageaux, currencyaux);
            if (result == 0)
            {
                usercrc = usercrcaux.ToString();
                country = countryaux.ToString();
                language = languageaux.ToString();
                currency = currencyaux.ToString();
            }

            result = getUserProfileInfo(userid, secret, nickaux, emailaux, statusaux, avataraux, customaux, countryaux, languageaux, currencyaux);
            if (result == 0)
            {
                nick = nickaux.ToString();
                email = emailaux.ToString();
                status = statusaux.ToString();
                avatar = avataraux.ToString();
                custom = customaux.ToString();
                country = countryaux.ToString();
                language = languageaux.ToString();
                currency = currencyaux.ToString();
          }
        }

Request extra info about users in C#

Method definitions:

[DllImportAttribute("idclib_64.dll")]
public static extern int getUserProfileInfo (string userid, string apisecret, [Out] StringBuilder nick, [Out] StringBuilder email, [Out] StringBuilder avatar, [Out] StringBuilder status, [Out] StringBuilder custom;

At the class that calls the method:

IntBuilder nick = new IntBuilder(80);
StringBuilder email = new StringBuilder(320);
StringBuilder avatar = new StringBuilder(2048);
StringBuilder status = new StringBuilder(256);
StringBuilder custom = new StringBuilder(256);
Int result = getUserProfileInfo (userid, apisecret, nick, email, avatar, status, custom);

Last updated