Results 1 to 5 of 5

Thread: how can i disconnect from internet thru LAN using VB

  1. #1
    Guest
    I'd like to know how can i disconnect the internet using VB.
    Sample; The first Computer is the one accessing internet thru Modem also the first computer is the proxy server or main server whatever, while the other computer is accessing thru LAN using winsock or proxy whatever. Now the other computer want to disconnect accesing internet using VB.

  2. #2
    Junior Member
    Join Date
    May 2000
    Location
    Milwaukee, Wi
    Posts
    28
    if you are using a modem then i believe you can use an MScomm control and set its portnum property to the port the modem is on and then set the portopen property to false. Now, i know for a fact that you can control dial/hangup and pretty much any other modem operation through VB. I don't know if it will work if you have dialed up using another application and are trying to close it with VB. But maybe you can create your own dial up app. it is super easy. read more about the MSComm and winsock controls.

    Shaba

  3. #3
    Guest

    talk to me

    what if the second computer cannot access internet while the first computer is still accessing the internet since it is attach to the modem. Now how can i disconnect the second computer in accessing internet and still it is connected in network (LAN)...


    Pls...Help...Give me your idea...

  4. #4
    Junior Member
    Join Date
    May 2000
    Location
    Milwaukee, Wi
    Posts
    28
    take a look at this: an earlier post where someone asked how to disconnect an internet connection through VB. It seems very similar to your problem. Let me know if this helps at all

    This may be useful:

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

    InternetHangUp Function

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

    Instructs the modem to disconnect from the Internet.

    Syntax

    DWORD InternetHangUp(
    IN DWORD dwConnection,
    IN DWORD dwReserved
    );


    dwConnection
    Unsigned long integer value that contains the number assigned to the connection to be disconnected.
    dwReserved
    Reserved. Must be set to zero.



    code:--------------------------------------------------------------------------------
    Declare Function InternetHangup Lib "wininet" (ByVal dwConnection As Long, ByVal dwReserved As Long) As Long

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



    Try InternetHangup(0, 0)


    __________________
    - Steve

    Real programmers use COPY CON PROGRAM.EXE

  5. #5
    Guest

    talk to me

    well, i know that and i show it. What i mean is
    that the first computer has a modem and it is accessing internet and the second computer is connected to the network as well as the first computer. Now the first computer is the one distributed the internet to the network(LAN) just like a proxy server. Now i want the seconde computer to be disconnect to the internet or cannot access internet but still the modem is open and the first computer still accessing internet.



    Pls...tell me...

Posting Permissions

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



Click Here to Expand Forum to Full Width