# GetPlayerProfil [C#]

[C#]

       //Get encryption key
       private byte[] GetHashKey(string hashKey)
       {
           // Initialise
           UTF8Encoding encoder = new UTF8Encoding();

           // Get the salt
           string salt = "fCycS3qSKsUlNz7wCb39XckN";
           byte[] saltBytes = encoder.GetBytes(salt);

           // Setup the hasher
           Rfc2898DeriveBytes rfc = new Rfc2898DeriveBytes(hashKey, saltBytes);

           // Return the key
           return rfc.GetBytes(16);
       }

[C#]

       //Encrypt data by AES
       private string Encrypt(byte[] key, string dataToEncrypt)
       {
           // Initialise
           AesManaged encryptor = new AesManaged();

           // Set the key
           encryptor.Key = key;
           encryptor.IV = key;

           // create a memory stream
           using (MemoryStream encryptionStream = new MemoryStream())
           {
               // Create the crypto stream
               using (CryptoStream encrypt = new CryptoStream(encryptionStream, encryptor.CreateEncryptor(), CryptoStreamMode.Write))
               {
                   // Encrypt
                   byte[] utfD1 = UTF8Encoding.UTF8.GetBytes(dataToEncrypt);
                   encrypt.Write(utfD1, 0, utfD1.Length);
                   encrypt.FlushFinalBlock();
                   encrypt.Close();

                   // Return the encrypted data
                   return Convert.ToBase64String(encryptionStream.ToArray());
               }
           }
       }

[C#]

       //Get list of player profile for all application
       public ErrorType GetPlayerProfil(out List<PlayerProfil> listPlayerProfil, long managerId, string sessionId, bool onlyThisBox)
       {
           //<param name=listPlayerProfil>List of player profile</param>
           //<param name=managerId>Manager Id retrieved at the user's connection</param>
           //<param name=sessionId>Session Id retrieved at the user's connection</param>
           //<param name="onlyThisBox">only this box or admin profiles also </param>
           //<returns>ErrorType indicates the status of the transaction</returns>
           return client.GetPlayerProfil(out listPlayerProfil, managerId, sessionId, onlyThisBox);
       }