Redeem Token
Redeeming a token will add to the users existing time. Tokens can only be redeemed once.
C# WINFORMS
/* C# WINFORMS */
using TrinitySeal;
private void Button1_Click() { // Redeem token button event handler
SealCheck.HashChecks(); // Check integrity of auth files
if (SealCheck.isValidDLL) {
// The register arguments goes in the order: username, password, token
bool response = TrinitySeal.Seal.RedeemToken(textBox1.Text, textBox2.Text, textBox3.Text);
if (response){
// Redeem token was successful
}
else {
// Redeem Token wasn't a success
}
}
}
C# CONSOLE
using TrinitySeal;
static void Main() {
Console.Title = "TrinitySeal";
Console.Write("Enter your username: ");
string username = Console.ReadLine();
Console.Write("Enter your password: ");
string password = Console.ReadLine();
Console.Write("Enter your token: ");
string token = Console.ReadLine();
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine("Redeeming token...");
Console.ForegroundColor = ConsoleColor.White;
SealCheck.HashChecks();
if (SealCheck.isValidDLL) {
bool response = TrinitySeal.Seal.RedeemToken(username, password, token, false);
if (response) {
Console.ForegroundColor = ConsoleColor.Green;
Console.WriteLine("Successfully redeemed token!");
Console.ForegroundColor = ConsoleColor.White;
Console.Read();
}
else{
Console.ForegroundColor = ConsoleColor.Red;
Console.WriteLine("Failed to redeem token!");
Console.Read();
}
}
else {
Environment.Exit(0);
}
}
VB FORM
Private Sub Button1_Click()
SealCheck.HashChecks()
If SealCheck.isValidDLL Then
Dim response As Boolean = TrinitySeal.Seal.RedeemToken(textBox1.Text, textBox2.Text, textBox3.Text)
If response Then
// Redeem Token Success
End If
End If
End Sub
VB CONSOLE
Private Shared Sub Main()
Console.Title = "TrinitySeal"
Console.Write("Enter your username: ")
Dim username As String = Console.ReadLine()
Console.Write("Enter your password: ")
Dim password As String = Console.ReadLine()
Console.Write("Enter your token: ")
Dim token As String = Console.ReadLine()
Console.ForegroundColor = ConsoleColor.Green
Console.WriteLine("Redeeming Token...")
Console.ForegroundColor = ConsoleColor.White
SealCheck.HashChecks()
If SealCheck.isValidDLL Then
Dim response As Boolean = TrinitySeal.Seal.RedeemToken(username, password, token, False)
If response Then
Console.ForegroundColor = ConsoleColor.Green
Console.WriteLine("Successfully redeemed token!")
Console.ForegroundColor = ConsoleColor.White
Console.Read()
Else
Console.ForegroundColor = ConsoleColor.Red
Console.WriteLine("Failed to redeem token!")
Console.Read()
End If
Else
Environment.[Exit](0)
End If
End Sub
Last updated