+ Responder ao Tópico



  1. Aqui neste mesmo tópico foi disponibilizado os fontes, não me lebro em qual, mas é só procurar.

  2. Citação Postado originalmente por scan Ver Post
    Aqui neste mesmo tópico foi disponibilizado os fontes, não me lebro em qual, mas é só procurar.
    Isso mesmo! tem sim! Porem dá erro ao baixar, entendeu?



  3. Procedure Pause(Secs : Integer);
    begin
    for i := 1 to Secs * 10 do begin
    Sleep(100);
    Application.ProcessMessages;
    end;
    end;
    procedure TfrmCommunication.btConnectClick(Sender: TObject);
    begin
    frmStart.sbStart.Panels[0].Text:='Conectando...';
    try
    if IdTelnet1.Connected then
    IdTelnet1.Disconnect;
    IdTelnet1.Host:= dbeIpServer.Text;
    IdTelnet1.Port:= StrToInt(dbePortServer.Text);
    idTelnet1.Connect;
    Pause(1);
    IdTelnet1.WriteLn(dbeUserServer.Text);
    Pause(1);
    IdTelnet1.WriteLn(dbePasswordServer.Text);
    Pause(1);
    if Length(Status)>100 then
    begin
    frmStart.sbStart.Panels[0].Text:='';
    btConnect.Enabled:= False;
    btDisconnect.Enabled:=True;
    stCon:=1;
    frmStart.sbStart.Panels[4].Text:='Conectado';
    dbeIpServer.Enabled:=False;
    dbePortServer.Enabled:=False;
    dbeUserServer.Enabled:=False;
    dbePasswordServer.Enabled:=False;
    dbeNameServer.Enabled:=False;
    dbnServer.Enabled:=False;
    Close;
    end;
    if Copy(Status,0,44)='Login failed, incorrect username or password' then
    begin
    frmStart.sbStart.Panels[0].Text:= 'Falha no login, usuário ou senha inválidos';
    btConnect.Enabled:= True;
    btDisconnect.Enabled:=False;
    stCon:=0;
    frmStart.sbStart.Panels[4].Text:='Desconectado';
    dbeIpServer.Enabled:=True;
    dbePortServer.Enabled:=True;
    dbeUserServer.Enabled:=True;
    dbePasswordServer.Enabled:=True;
    dbeNameServer.Enabled:=True;
    dbnServer.Enabled:=True;
    end;
    except
    frmStart.sbStart.Panels[0].Text:= 'Erro '+IntToStr(Length(Status))+': Disconnected';
    stCon:=0;
    frmStart.sbStart.Panels[4].Text:='Desconectado';
    dbeIpServer.Enabled:=True;
    dbePortServer.Enabled:=True;
    dbeUserServer.Enabled:=True;
    dbePasswordServer.Enabled:=True;
    dbeNameServer.Enabled:=True;
    dbnServer.Enabled:=True;
    end;
    end;
    procedure TfrmCommunication.IdTelnet1DataAvailable(Sender: TIdTelnet;
    const Buffer: String);
    begin
    Status:= Buffer;
    end;
    procedure TfrmCommunication.btDisconnectClick(Sender: TObject);
    begin
    IdTelnet1.Disconnect;
    btConnect.Enabled:= True;
    btDisconnect.Enabled:=False;
    frmStart.sbStart.Panels[0].Text:='';
    stCon:=0;
    frmStart.sbStart.Panels[4].Text:='Desconectado';
    dbeIpServer.Enabled:=True;
    dbePortServer.Enabled:=True;
    dbeUserServer.Enabled:=True;
    dbePasswordServer.Enabled:=True;
    dbeNameServer.Enabled:=True;
    dbnServer.Enabled:=True;

    end;

  4. procedure TfrmData.btClientsClick(Sender: TObject);
    begin
    //ALTERA LOGIN
    frmCommunication.IdTelnet1.WriteLn('/');
    if frmData.dbLogin.Text<>''then
    frmCommunication.IdTelnet1.WriteLn('/ppp secret set [find comment="'+frmData.tblClientsAUTOINC.Text+'"] name='+frmData.dbLogin.Text);
    //CADASTRA CLIENTE
    frmCommunication.IdTelnet1.WriteLn('/');
    if frmData.dbAutoInc.Text<>''then
    begin
    frmCommunication.IdTelnet1.WriteLn('/ ppp secret add name='+frmData.dbLogin.Text+' service=pppoe password='+frmData.dbPassword.Text+' profile='+frmData.dblcPlanos.Text+' comment='+frmData.dbAutoInc.Text+' disabled=no');
    //ALTERA MAC
    frmCommunication.IdTelnet1.WriteLn('/');
    if Length(frmData.dbID.Text)=17 then
    begin
    frmCommunication.IdTelnet1.WriteLn('/ppp secret set [find comment="'+frmData.tblClientsAUTOINC.Text+'"] caller-id="'+frmData.dbID.Text+'"');
    end
    else
    begin
    frmCommunication.IdTelnet1.WriteLn('/ppp secret set [find comment="'+frmData.tblClientsAUTOINC.Text+'"] caller-id=""');
    end;
    //ALTERA O IP
    frmCommunication.IdTelnet1.WriteLn('/');
    if Length(frmData.dbIPFixo.Text)>7 then
    begin
    frmCommunication.IdTelnet1.WriteLn('/ppp secret set [find comment="'+frmData.tblClientsAUTOINC.Text+'"] remote-address="'+frmData.dbIPFixo.Text+'"');
    end
    else
    begin
    frmCommunication.IdTelnet1.WriteLn('/ppp secret unset [find comment="'+frmData.tblClientsAUTOINC.Text+'"] remote-address');
    end;
    //LIBERA OU BLOQUEIA CLIENTE
    frmCommunication.IdTelnet1.WriteLn('/');
    if frmData.dbSuspenso.Checked=True then
    begin
    frmCommunication.IdTelnet1.WriteLn('/ppp secret set [find comment="'+frmData.tblClientsAUTOINC.Text+'"] disabled=yes');
    end
    else
    begin
    frmCommunication.IdTelnet1.WriteLn('/ppp secret set [find comment="'+frmData.tblClientsAUTOINC.Text+'"] disabled=no');
    end;
    //ALTERA SENHA
    frmCommunication.IdTelnet1.WriteLn('/');
    if frmData.dbPassword.Text<>''then
    begin
    frmCommunication.IdTelnet1.WriteLn('/ppp secret set [find comment="'+frmData.tblClientsAUTOINC.Text+'"] password="'+frmData.dbPassword.Text+'"');
    end
    else
    begin
    frmCommunication.IdTelnet1.WriteLn('/ppp secret set [find comment="'+frmData.tblClientsAUTOINC.Text+'"] password=""');
    end;
    //ALTERA PLANO
    frmCommunication.IdTelnet1.WriteLn('/');
    if dbPassword.Text<>''then
    frmCommunication.IdTelnet1.WriteLn('/ppp secret set [find comment="'+frmData.tblClientsAUTOINC.Text+'"] profile="'+frmData.dblcPlanos.Text+'"');
    end;
    end;









Tópicos Similares

  1. Respostas: 0
    Último Post: 22-03-2017, 11:24
  2. Respostas: 23
    Último Post: 27-02-2017, 08:10
  3. Respostas: 1
    Último Post: 14-05-2015, 05:54
  4. Conprove - Controle de Provedor Mikrotik
    Por m4d3 no fórum Redes
    Respostas: 12
    Último Post: 24-03-2008, 00:21
  5. AP COM CONTROLE DE MAC MIKROTIK
    Por squid_br no fórum Redes
    Respostas: 2
    Último Post: 18-10-2006, 15:17

Visite: BR-Linux ·  VivaOLinux ·  Dicas-L