SPONSORS:






User Tag List

Results 1 to 6 of 6

Thread: RAS Connection

  1. #1
    Member
    Join Date
    Dec 1999
    Location
    Columbus, OH
    Posts
    78
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    RAS Connection

    I am trying to develop a method that can detect if a RAS connection is established and close it if necessary. I have tried using the RASAPI32.dll function RasHangUp(Ulong hConnection) but I do not know the handle of the connection and I do not know how to obtain it. I can click on the modem icon in the taskbar but this is related to position which I would like to avoid. The script has to run on All windows platforms.

    I appreciate any help.

  2. #2
    Guest

    Re: RAS Connection

    Below are snippets of code that can be used to do the following:
    IsDUNConnected() - determine whether or not a RAS connection exists
    GetConnectedISP() - returns the name of the DUN account currently connected
    GetISPNames() - returns the names of all DUN accounts
    These functions access the system registry to determine RAS connection and DUN account status. The RegValueExists(), RegGetValue(), and RegValueEnumerate() functions are provided to facilitate that access.

    The window declaration for the DUN Connected To dialog is provided for disconnecting an active DUN connection by a call to the DUN_Disconnect() function. This method is more reliable than trying to interact with the taskbar icon. For the sake of brevity, I've trimmed out the extraneous control declarations for this dialog.

    This code is part of a library of window declarations, methods, and functions I created for interacting with MS Dial-Up Networking.


    ------------------

    Tony Mrozinski
    Sr. Software Test Automation Engineer
    Home Networking Operations
    Intel Corporation

  3. #3
    Member
    Join Date
    Dec 1999
    Location
    Columbus, OH
    Posts
    78
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: RAS Connection

    When I tried to compile the above code I received the following errors:

    Function GetWindowsPath is not defined
    Variable KEY_READ is not defined
    Variable KEY_WRITE is not defined

    Is there some include files that I may be missing?

  4. #4
    Guest

    Re: RAS Connection

    Sorry about that. The registry functions and the windows path function came from a different include files. Here's the missing pieces...


    ------------------

    Tony Mrozinski
    Sr. Software Test Automation Engineer
    Home Networking Operations
    Intel Corporation

  5. #5
    Member
    Join Date
    Dec 1999
    Location
    Columbus, OH
    Posts
    78
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: RAS Connection

    Thanks!

    This works perfectly and was exactly what I was looking for.

  6. #6
    AJ
    AJ is offline
    Moderator AJ's Avatar
    Join Date
    Jun 1999
    Location
    San Jose, CA
    Posts
    1,691
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: RAS Connection

    Hi Tony,

    If you would like me to host any (shrunk-down) libraries, please let me know

    I know you have plenty of experience in SilkTest and you probably have some nice functions written up



    ------------------
    AJ Alhait
    BetaSoft Inc.
    AJ Alhait
    BetaSoft Inc.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 12:47 AM.

Copyright BetaSoft Inc.