public static void Main()
string ClientName = "devpost";
string Password = "23C55D8DBCF394B74603478C62B32EC3";
string Keyword = "CelcomDCBTest1";
string dateTime = DateTime.UtcNow.AddHours(+8).ToString("yyyyMMddHHmmss");
if (!string.IsNullOrWhiteSpace(ShortCode))
Password = CreateMD5(Password);
string accessToken = ClientName + Keyword + ShortCode + dateTime + Password;
accessToken = accessToken.ToUpper();
accessToken = CreateMD5(accessToken);
if (!string.IsNullOrWhiteSpace(ShortCode))
Console.WriteLine("http://sit.mis.etracker.cc/MYPSMSToken/GetToken?AccessToken=" + accessToken + "&Keyword=" + Keyword + "&ShortCode=" + ShortCode + "&DateTime=" + dateTime);
Console.WriteLine("http://sit.mis.etracker.cc/MYDCBToken/GetToken?AccessToken=" + accessToken + "&ServiceName=" + Keyword + "&&DateTime=" + dateTime);
public static string CreateMD5(string input)
using (System.Security.Cryptography.MD5 md5 = System.Security.Cryptography.MD5.Create())
byte[] inputBytes = System.Text.Encoding.ASCII.GetBytes(input);
byte[] hashBytes = md5.ComputeHash(inputBytes);
StringBuilder sb = new StringBuilder();
for (int i = 0; i < hashBytes.Length; i++)
sb.Append(hashBytes[i].ToString("X2"));