Exemplo n.º 1
0
 /// <summary>
 /// 拨
 /// </summary>
 /// <param name="unMsg"></param>
 /// <param name="rasconnstate"></param>
 /// <param name="dwError"></param>
 private void RasDialFunc(uint unMsg, RASCONNSTATE rasconnstate, int dwError)
 {
     if (dwError != 0)
     {
         this.ConnectNotify(this.GetErrorString(dwError), 3);
         this.bConnected = false;
         if (this.hrasconn != 0)
         {
             int nErrorValue = RasHangUp(this.hrasconn);
             if (nErrorValue == 0)
             {
                 this.ConnectNotify("连接中断.", 0);
             }
             else
             {
                 this.ConnectNotify(this.GetErrorString(nErrorValue), 0);
             }
         }
     }
     else
     {
         if (rasconnstate == RASCONNSTATE.RASCS_PortOpened)
         {
             this.ConnectNotify("端口已经打开.", 1);
         }
         if (rasconnstate == RASCONNSTATE.RASCS_ConnectDevice)
         {
             this.ConnectNotify("正在拨...", 1);
         }
         if (rasconnstate == RASCONNSTATE.RASCS_Authenticate)
         {
             this.ConnectNotify("正在验证用户名与密码.", 1);
         }
         if (rasconnstate == RASCONNSTATE.RASCS_Connected)
         {
             this.bConnected = true;
             this.ConnectNotify("成功连接到" + this.EntryName + '.', 2);
         }
     }
 }
Exemplo n.º 2
0
 /// <summary>
 /// 拨
 /// </summary>
 /// <param name="unMsg"></param>
 /// <param name="rasconnstate"></param>
 /// <param name="dwError"></param>
 private void RasDialFunc(uint unMsg, RASCONNSTATE rasconnstate, int dwError)
 {
     if (dwError != 0)
     {
         this.ConnectNotify(this.GetErrorString(dwError), 3);
         this.bConnected = false;
         if (this.hrasconn != 0)
         {
             int nErrorValue = RasHangUp(this.hrasconn);
             if (nErrorValue == 0)
             {
                 this.ConnectNotify("连接中断.", 0);
             }
             else
             {
                 this.ConnectNotify(this.GetErrorString(nErrorValue), 0);
             }
         }
     }
     else
     {
         if (rasconnstate == RASCONNSTATE.RASCS_PortOpened)
         {
             this.ConnectNotify("端口已经打开.", 1);
         }
         if (rasconnstate == RASCONNSTATE.RASCS_ConnectDevice)
         {
             this.ConnectNotify("正在拨...", 1);
         }
         if (rasconnstate == RASCONNSTATE.RASCS_Authenticate)
         {
             this.ConnectNotify("正在验证用户名与密码.", 1);
         }
         if (rasconnstate == RASCONNSTATE.RASCS_Connected)
         {
             this.bConnected = true;
             this.ConnectNotify("成功连接到" + this.EntryName + '.', 2);
         }
     }
 }