Главная страница
    Top.Mail.Ru    Яндекс.Метрика
Форум: "Система";
Текущий архив: 2003.06.16;
Скачать: [xml.tar.bz2];

Вниз

Неужели никто не знает?!!!. Как в 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;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.45 MB
Время: 0.007 c
1-50398
EvgeniyR
2003-05-30 10:24
2003.06.16
Генератор случайных чисел


1-50313
McSimm2
2003-06-03 11:55
2003.06.16
Снова ComboBox


1-50333
VD601
2003-06-02 21:43
2003.06.16
О тос, как передаются данные.


1-50345
HardClubber
2003-06-03 17:54
2003.06.16
Расположение WebBrowser


14-50463
Andrey Filatow
2003-05-29 20:55
2003.06.16
Rave report





Afrikaans Albanian Arabic Armenian Azerbaijani Basque Belarusian Bulgarian Catalan Chinese (Simplified) Chinese (Traditional) Croatian Czech Danish Dutch English Estonian Filipino Finnish French
Galician Georgian German Greek Haitian Creole Hebrew Hindi Hungarian Icelandic Indonesian Irish Italian Japanese Korean Latvian Lithuanian Macedonian Malay Maltese Norwegian
Persian Polish Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Swahili Swedish Thai Turkish Ukrainian Urdu Vietnamese Welsh Yiddish Bengali Bosnian
Cebuano Esperanto Gujarati Hausa Hmong Igbo Javanese Kannada Khmer Lao Latin Maori Marathi Mongolian Nepali Punjabi Somali Tamil Telugu Yoruba
Zulu
Английский Французский Немецкий Итальянский Португальский Русский Испанский