Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2003.06.16;
Скачать: CL | DM;

Вниз

Неужели никто не знает?!!!. Как в Delphi можно отключить польз..   Найти похожие ветки 

 
yura   (2003-04-10 18:28) [0]

Нужно програмно отключить пользователя, который подключился через модем (windows 2000 srv). Или как отрубать модем, когда пользователь подключен. В одном faqе нашел что-то похожее:

Эта процедура прервет все соединения которые найдет
procedure HangupAll;
var
i:CARDINAL;
ConnArray:array[0..10] of TRASConn;
Connections,BufSize:Longint;
begin
for i:=Low(ConnArray) to High(ConnArray) do
ConnArray[i].dwSize:=SizeOf(ConnArray[i]);
BufSize:=Sizeof(ConnArray);
RasEnumConnections(@ConnArray[Low(ConnArray)], BufSize, Connections);
if Connections = 0 then exit;
for i:=Low(ConnArray) to Connections - 1 do
RasHangup(ConnArray[i].hrasConn);
end;

Процедура прекрасно работает с dual-up, но dial-in - ну никак.
Т.е. входящие подключения не понимает и пользователя удаленного
соединения не видит. В чем может быть проблема, может incoming
connection как-то по другому работают, чем dual-up? Кроме того,
обычная команда rasdial в винде, которая показывает какие есть
соединения, тоже не видит входящие.
Буду очень благодарен, если поможете, емайл: bozn@svitonline.com


 
Hexxx   (2003-04-10 23:44) [1]

Единственное что я нашел поэтому поводу:
The RasAdminConnectionHangupNotification function is an application-defined function that is exported by a third-party RAS server administration DLL. When RAS disconnects an existing connection, it calls this function to notify your DLL.
The RAS server calls RasAdminConnectionHangupNotification once for each port in a multilink connection.

VOID RasAdminConnectionHangupNotification(

RAS_PORT_1 *pRasPort1, // pointer to information about the connection
RAS_PORT_STATISTICS *pRasStats, // pointer to statistics about the port
RAS_PARAMETERS *pRasParams // pointer to an array of media-specific parameters and values
);


Parameters

pRasPort1

Pointer to a RAS_PORT_1 structure that contains RAS data about the connection that ended. This structure contains the relevant connection information that you can use to determine how long the port was connected.

pRasStats

Pointer to a RAS_PORT_STATISTICS structure that contains statistics about the port. RAS began accumulating these statistics when the connection was first established.

pRasParams

Pointer to an array of RAS_PARAMETERS structures. Each structure contains the name of a media-specific key, such as MAXCONNECTBPS, and its associated value.


The RasAdminReleaseIpAddress function is an application-defined function that is exported by a third-party RAS server administration DLL. RAS calls this function to notify your DLL that the remote client was disconnected and that the IP address should be released.

VOID RasAdminReleaseIpAddress(

WCHAR *lpszUserName, // pointer to the name of the remote user
WCHAR *lpszPortName, // pointer to the name of the port
IPADDR *pipAddress // pointer to the IP address
);


Parameters

lpszUserName

Pointer to a null-terminated Unicode string that contains the name of a remote user for whom an IP address was previously obtained using the RasAdminGetIpAddressForUser function.

lpszPortName

Pointer to a null-terminated Unicode string that contains the name of the port on which the user specified by lpszUserName is connected.

pipAddress

Pointer to an IPADDR variable that contains the IP address returned for this user in a previous call to RasAdminGetIpAddressForUser.



 
yura   (2003-04-11 11:00) [2]

Я не очень силен в API, чтобы это все проверить сразу. Но если винда не смотрит на входящие как на rasdialьное соединение...
В чем же разница между dial-up и dial-in?



Страницы: 1 вся ветка

Текущий архив: 2003.06.16;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.009 c
6-50429
VIB
2003-04-12 11:57
2003.06.16
Application


1-50343
super_alex
2003-06-03 18:00
2003.06.16
Про комплексные числа


3-50259
Maxxx
2003-05-26 07:15
2003.06.16
Помогите с запросом


3-50245
Юлия
2003-05-24 09:01
2003.06.16
Поиск записей


14-50489
Piero
2003-05-30 13:42
2003.06.16
Где взять Delphi5 UpDate ?