Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / January 2006

Tip: Looking for answers? Try searching our database.

Getting sttaus of RAs connection not working

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
den 2005 - 06 Jan 2006 02:43 GMT
Hi everybody,
 Is there someone who can tell me why the RASGetConnectStatus() is not
functioning and how to fixed this? I like to get status of ras in order to
maintain the connection until explicitly close by user. Also, the RasHangUp()
also not working properly. Thanks in Advance.

[code]
private void ReconnectVPNRAS()
{
  while (this.CheckRasConnection(this.IDConnexionRAS) == false)
  {
    string connectName = this.txtIpAddress.Text;
    string user = this.txtUsername.Text;
    string pass = this.txtPassword.Text;
       
    this.OpenConnection(connectName,user,pass,"");
    Thread.Sleep(1000);
  }
}

public bool OpenConnection(string pNomConnection,string pUser,string
pPassword,string pDomain)
{
  .....

  uint res = RasDial(0,null,TabParams,0,0,ref IDConnexionRAS);
  .....
}
[\code]

[code]
public bool GetRasConnectStatus(int idConn)
{           
  uint res = RasAPI.RasGetConnectStatus(idConn, ref status);
  if (res == 0)
  {
    status.rasconnstate = RASCONNSTATE.RASCS_Connected;
    return true;
  }
  else
  {
    status.rasconnstate = RASCONNSTATE.RASCS_Disconnected;
    return false;
  }
}

[DllImport("rasapi32.dll",CharSet=CharSet.Auto)]
public extern static uint RasGetConnectStatus(
    int pRasConn,  // handle to RAS connection of interest
    ref RASCONNSTATUS lprasconnstatus
    // buffer to receive status data
);
[\code]

den2005

Signature

MCP Year 2005, Philippines

den 2005 - 07 Jan 2006 08:04 GMT
Update

Hi everybody,
 Unable to resolve the size of RasConnStatus which causing the
RasGetConnectStatus() of code # 632. Is there anyone who can tell me how to
get the correct size (structure) for the RasConstatus? Thanks in Advanced.

den2005
Signature

MCP Year 2005, Philippines

> Hi everybody,
>   Is there someone who can tell me why the RASGetConnectStatus() is not
[quoted text clipped - 51 lines]
>
> den2005

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.