Oh! you got it, I forgot about it, here it is...
Hope you can help
int HexToInteger(string str){ int result=0; int power=0; for(int pos=StringLen(str)-1; pos>=0; pos--){ int c=StringGetChar( str, pos); int value = 0; if(c>='0' && c<='9') value=c-'0'; else if(c>='a' && c<='f') value=c-'a'+10; else if(c>='A' && c<='F') value=c-'A'+10; result += value*MathPow(16.0, power); power++; } return(result); }
me
yes
Riccardo Fornasiero:
Does anyone can help me about this problem ?
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi, I need to develop a license generator in vb.net that allows me to create license keys that I will subsequently decode using the CryptEncode MQL function.
Anyone can help me ?
I used this VB.NET function to generate the license
Public Function EncryptString(ByVal inputString As String) As String Dim memStream As MemoryStream = Nothing Try Dim byteInput As Byte() = Encoding.ASCII.GetBytes(inputString) Dim encryptKey As String = "4c85a221" ' MUST be 8 characters Dim key As Byte() = {} key = Encoding.ASCII.GetBytes(encryptKey) Dim provider As DESCryptoServiceProvider = New DESCryptoServiceProvider() memStream = New MemoryStream() Dim transform As ICryptoTransform = provider.CreateEncryptor(key, Nothing) Dim CryptoStream As CryptoStream = New CryptoStream(memStream, transform, CryptoStreamMode.Write) CryptoStream.Write(byteInput, 0, byteInput.Length) CryptoStream.FlushFinalBlock() Return (System.Text.ASCIIEncoding.ASCII.GetString(memStream.ToArray())) Catch ex As Exception Console.WriteLine(ex.Message) Return Nothing End Try End FunctionBut when I try to dectript with the following MQL function, I can not get any results and after many attempts I'm really in trouble !!!
Can anyone of you to help me or point me a way to solve my problem?