Click to See Complete Forum and Search --> : how can i disconnect from internet thru LAN using VB
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.
shaba
Jun 2nd, 2000, 12:00 AM
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
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...
shaba
Jun 2nd, 2000, 03:40 AM
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
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...
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.