🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: fr.comp.os.ms-windows.programmation
Article #75

Re: Couper la connexion internet

#75
From: R�gent
Date: Sat, 04 Sep 1999 00:00
42 lines
1763 bytes
> Mais comment faire pour couper cette connexion ???
> Que ce soit en C++, Java, VB, ... ou d�j� compil�,
> je suis perneur de tout !
> (Il s'agit de W98)

en C++
---------

#include <ras.h>

VOID Disconnect ()
{
 RASCONN rc;
 DWORD cConnections;
 rc.dwSize = sizeof (rc);
 RasEnumConnections (&rc, &rc.dwSize, &cConnections);
 RasHangUp (rc.hrasconn);
}

en VB :
---------

Type RASCONN
    dwsize As Long
    hRascon As Long
    szentryname As String * 256
    szdevicetype As String * 16
    szdevicename As String * 32
End Type

Declare Function RasEnumConnections Lib "RasApi32.dll" Alias
"RasEnumConnectionsA" (lpRasCon As Any, lpcb As Long, lpcConnection As Long)
As Long
Declare Function RasHangup Lib "RasApi32.dll" Alias "RasHangUpA" (ByVal
hRascon As Long) As Long

Sub Disconnect ()
    Dim RC As RASCONN
    RC.dwsize = Len(RC) + 100
    RasEnumConnections RC, RC.dwsize, 0&
    RasHangup RC.hRascon
End Sub
Technical Details
Message-ID: <7qr52u$8bc$1@wanadoo.fr>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <37D0CA00.BC57570@pyramida.org>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 1053e6,703ad6b9a8d27f8c
X-Google-Attributes: gid1053e6,public
X-Google-Thread: 100048,703ad6b9a8d27f8c
X-Google-Attributes: gid100048,public
From: "R�gent" <regent@yahoo.fr>
Subject: Re: Couper la connexion internet
Date: 1999/09/04
Message-ID: <7qr52u$8bc$1@wanadoo.fr>
X-Deja-AN: 520983551
References: <37D0CA00.BC57570@pyramida.org>
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2014.211
X-Complaints-To: abuse@wanadoo.fr
X-Trace: wanadoo.fr 936449950 8556 164.138.137.102 (4 Sep 1999 12:59:10 GMT)
Organization: Wanadoo, l'internet avec France Telecom
X-MSMail-Priority: Normal
NNTP-Posting-Date: 4 Sep 1999 12:59:10 GMT
Newsgroups: fr.comp.os.ms-windows.programmation,fr.comp.infosystemes.www.auteurs