Download MetaTrader 5

Password protected indicator.

To add comments, please log in or register
nvn2005
8
nvn2005 2011.02.05 09:29 

I want to password protected my indicator, below is what I can come up with but there is a flaw. I don't want the real characters to show when user type password in the inputs box instead replace the typed character with asterisks * could someone help me fix it? thanks.

input string  password = "0";

void OnInit()

  {

  if (password != "abcd") //<-- Assigned password.
      {  
      Alert ("Wrong password!");
       return;
       }

Alexander Piechotta
6974
Alexander Piechotta 2011.02.05 14:19  
Ilyas
1209
Ilyas 2011.02.07 17:19  
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
   if(PASSWORD!="ABC")
     {
      Print("BAD PASSWORD");
      return(-1);
     }
   ...
   //--- SUCCESS
   return(0);
  }


nvn2005
8
nvn2005 2011.02.07 21:45  
mql5 thanks for you reply, but your method still does not mask out the inputs characters. ABC still display (anyone could read the pw if shown)... should be *** when user type in ABC.
mql5:



To add comments, please log in or register