0

I have made an PPP dialer using C# & DOTRAS. When I enter wrong username and password, I get this exception error.

RasExecption occured: The remote connection was denied because the user name and password combination you provided is not recognized, or the selected authentication protocol is not permitted on the remote access server.

RASEXCEPTION dueto incorrect user/pass

I have tried to catch this error and make it appear in text box, but failed.

var conns = RasConnection.GetActiveConnections();
var conn = conns.FirstOrDefault(o => o.EntryName == Globals.PPPNAME);
if (conn != null)
{
    this.StatusTextBox.AppendText(string.Format("{0}\r\n\r\n", "Dialer already connected !"));
}
else
    try
    {
        this.rasDialer1.DialAsync();

    }

    catch(RasException ex)
    {

    this.StatusTextBox.AppendText("\r\n" + ex.Message + "USERNAME PASSWORD IS INVALID...");
    }
Steve
  • 213,761
  • 22
  • 232
  • 286
iBBi
  • 129
  • 2
  • 12
  • Did you check your exception settings? See http://stackoverflow.com/questions/31549030/visual-studio-2015-break-on-unhandled-exceptions-not-working – Steve May 02 '17 at 13:01
  • I am using VS2012 on Windows 7 64bit. I tried to change RasExeception to Exception as well but no use., – iBBi May 02 '17 at 15:58

0 Answers0