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

Вниз

Пользователи, запустившие программу.   Найти похожие ветки 

 
kyn66 ©   (2006-11-09 11:41) [0]

Добрый день. Есть задача. На сервере лежит программа, которую запускают разные пользователи сети. Каким образом вывести список пользователей, у которых в данный момент запущено приложение. Повторяю, программа лежит на сервере.


 
Jeer ©   (2006-11-09 11:51) [1]

netfileenum


 
kyn66 ©   (2006-11-09 12:03) [2]

Это функция или ... ?


 
Jeer ©   (2006-11-09 12:16) [3]

The NetFileEnum function supplies information about some or all open files on a server, allowing the user to supply a resume handle and get required information through repeated calls to the function.

Security Requirements:

Only members of the Administrators or Account Operators local group can successfully execute NetFileEnum.


 
kyn66 ©   (2006-11-09 12:22) [4]

что-то ничего подходящего поэтой функции не отрыл


 
Anatoly Podgoretsky ©   (2006-11-09 12:52) [5]

> Jeer  (09.11.2006 11:51:01)  [1]

Ты о чем думал, когда советовал?


 
Jeer ©   (2006-11-09 12:56) [6]


> Anatoly Podgoretsky ©   (09.11.06 12:52) [5]


Неужели не тем местом ? :)))
Ужас.


 
Palladin ©   (2006-11-09 13:02) [7]


> Jeer ©   (09.11.06 12:56) [6]

Тем, но, ИМХО, оно не совместимо с его контейнером микроэлектроимпульсов...


 
Jeer ©   (2006-11-09 13:06) [8]

Palladin ©   (09.11.06 13:02) [7]

Замкнуло беднягу ?
Ну хоть спросить успел.


 
Anatoly Podgoretsky ©   (2006-11-09 13:19) [9]


> Неужели не тем местом ? :)))

В правильном направление мыслишь. Ты бы учитывал все таки автора, неужели не знаком?


 
Anatoly Podgoretsky ©   (2006-11-09 13:20) [10]


> Ну хоть спросить успел.

Так ветка не закрыта, какие проблемы.
Твой прогноз когда вернется?


 
Ketmar ©   (2006-11-09 13:21) [11]

>[10] Anatoly Podgoretsky(c) 9-Nov-2006, 13:20
>Твой прогноз когда вернется?
как система из резервной копии поднимется.


 
Jeer ©   (2006-11-09 13:51) [12]


> Ты бы учитывал все таки автора, неужели не знаком?


Не пришлось:)


> Твой прогноз когда вернется?


Думаю, только после инсталляции нового девайса и еще ждать [11]
В общем - недолго, у них это быстро.


 
Anatoly Podgoretsky ©   (2006-11-09 13:58) [13]

Вы случайно не посоветовали ему задосить 127.0.0.1


 
Ketmar ©   (2006-11-09 14:53) [14]

>[13] Anatoly Podgoretsky(c) 9-Nov-2006, 13:58
>Вы случайно не посоветовали ему задосить 127.0.0.1
может, сам догадался? %-)


 
Anatoly Podgoretsky ©   (2006-11-09 15:05) [15]

> Ketmar  (09.11.2006 14:53:14)  [14]

Симптомы похожи


 
evvcom ©   (2006-11-09 15:17) [16]

Все гораздо проще:
1 Goto 1 :)))


 
Vovan69   (2006-11-09 16:02) [17]

Ну а все-таки интересно: как запустить функцию netfileenum, какими параметрами накормить и что она возвращает?

(это вместо того, чтобы прикалываться, уважаемые Мастера)


 
novill ©   (2006-11-09 16:15) [18]

> [17] Vovan69   (09.11.06 16:02)

RTFM MSDN

NetFileEnum

The NetFileEnum function returns information about some or all open files on a server, depending on the parameters specified.

Windows Me/98/95:  The parameters for this function are different from those listed in the syntax block. For more information and syntax, see the Windows Me/98/95 information in the Remarks section.

NET_API_STATUS NetFileEnum(
 LMSTR servername,
 LMSTR basepath,
 LMSTR username,
 DWORD level,
 LPBYTE* bufptr,
 DWORD prefmaxlen,
 LPDWORD entriesread,
 LPDWORD totalentries,
 PDWORD_PTR resume_handle
);

Parameters
servername
[in] Pointer to a string that specifies the DNS or NetBIOS name of the remote server on which the function is to execute. If this parameter is NULL, the local computer is used.
This string is Unicode if _WIN32_WINNT or FORCE_UNICODE are defined.

Windows NT:  This string must begin with \\.
basepath
[in] Pointer to a string that specifies a qualifier for the returned information. If this parameter is NULL, all open resources are enumerated. If this parameter is not NULL, the function enumerates only resources that have basepath as a prefix. (A prefix is the path component up to a backslash.)
This string is Unicode if _WIN32_WINNT or FORCE_UNICODE are defined.

username
[in] Pointer to a string that specifies the name of the user. If this parameter is specified, username serves as a qualifier for the enumeration. The files returned are limited to those that have user names matching the qualifier. If this parameter is NULL, no user-name qualifier is used.
This string is Unicode if _WIN32_WINNT or FORCE_UNICODE are defined.

level
[in] Specifies the information level of the data. This parameter can be one of the following values. Value Meaning
2 Return the file identification number. The bufptr parameter points to an array of FILE_INFO_2 structures.
Windows Me/98/95:  This value is not supported.
3 Return information about the file. The bufptr parameter points to an array of FILE_INFO_3 structures.
Windows Me/98/95:  This value is not supported.
50 Windows Me/98/95:  Return information about the file. The returned buffer contains an array of file_info_50 structures.

bufptr
[out] Pointer to the address of the buffer that receives the information. The format of this data depends on the value of the level parameter.
This buffer is allocated by the system and must be freed using the NetApiBufferFree function. Note that you must free the buffer even if the function fails with ERROR_MORE_DATA.

Windows Me/98/95:  The caller must allocate and deallocate this buffer.

prefmaxlen
[in] Specifies the preferred maximum length of returned data, in bytes. If you specify MAX_PREFERRED_LENGTH, the function allocates the amount of memory required for the data. If you specify another value in this parameter, it can restrict the number of bytes that the function returns. If the buffer size is insufficient to hold all entries, the function returns ERROR_MORE_DATA. For more information, see Network Management Function Buffers and Network Management Function Buffer Lengths.
entriesread
[out] Pointer to a value that receives the count of elements actually enumerated.
totalentries
[out] Pointer to a value that receives the total number of entries that could have been enumerated from the current resume position. Note that applications should consider this value only as a hint.
resume_handle
[in, out] Pointer to a value that contains a resume handle which is used to continue an existing file search. The handle should be zero on the first call and left unchanged for subsequent calls. If resume_handle is NULL, then no resume handle is stored.
Return Values
If the function succeeds, the return value is NERR_Success.

If the function fails, the return value can be one of the following error codes.

Return code Description
ERROR_ACCESS_DENIED The user does not have access to the requested information.
ERROR_INVALID_LEVEL The value specified for the level parameter is invalid.
ERROR_MORE_DATA More entries are available. Specify a large enough buffer to receive all entries.
ERROR_NOT_ENOUGH_MEMORY Insufficient memory is available.
NERR_BufTooSmall The supplied buffer is too small.

Remarks
Only members of the Administrators or Server Operators local group can successfully execute the NetFileEnum function.

You can call the NetFileGetInfo function to retrieve information about a particular opening of a server resource.

If you are programming for Active Directory, you may be able to call certain Active Directory Service Interface (ADSI) methods to achieve the same functionality you can achieve by calling NetFileEnum. For more information, see IADsResource and IADsFileServiceOperations.

Windows Me/98/95:  The calling application must use the cbBuffer parameter to specify the size, in bytes, of the information buffer pointed to by the pbBuffer parameter. (The cbBuffer parameter replaces the prefmaxlen parameter.) Neither a user name parameter nor a resume handle parameter is available on this platform. Therefore, the parameter list is as follows.
extern API_FUNCTION
NetFileEnum(
 const char FAR * pszServer,        
 const char FAR * pszBasePath,      
 short sLevel,                      
 char FAR * pbBuffer,              
 unsigned short cbBuffer,          
 unsigned short FAR * pcEntriesRead,
 unsigned short FAR * pcTotalAvail  
);
See the NetFileEnum Sample (Windows 95/98/Me) topic to view a code sample that demonstrates how to use the NetFileEnum function.

Requirements
Client: Requires Windows XP, Windows 2000 Professional, Windows NT Workstation, Windows Me, Windows 98, or Windows 95.
Server: Requires Windows Server 2003, Windows 2000 Server, or Windows NT Server.
Header: Declared in Lmshare.h (Svrapi.h on Windows Me/98/95); include Lm.h (Svrapi.h on Windows Me/98/95).
Library: Use Netapi32.lib (use Svrapi.lib on Windows Me/98/95).

See Also
Network Management Overview, Network Management Functions, NetFile Functions, FILE_INFO_2, FILE_INFO_3, file_info_50, NetFileGetInfo



 
Jeer ©   (2006-11-09 16:16) [19]

Что-то развелось нумерных кунов и вованов.
Это номер релиза, апгрейда ?

NET_API_STATUS NetFileEnum(

LPTSTR servername,
LPTSTR basepath,
LPTSTR username,
DWORD level,
LPBYTE *bufptr,
DWORD prefmaxlen,
LPDWORD entriesread,
LPDWORD totalentries,
LPDWORD resume_handle
);

Интересовать должен 5-й параметр.
Можно его так представить:

TFInfo = record
  fi3_id: DWORD;
  fi3_permissions: DWORD;
  fi3_num_locks: DWORD;
  fi3_pathname: PWideChar;
  fi3_username: PWideChar;
end;

дальше - в msdn, быстрее научитесь.


 
Ketmar ©   (2006-11-09 16:17) [20]

мда. система поднялась с ошибками, видимо.


 
Anatoly Podgoretsky ©   (2006-11-09 16:33) [21]

> novill  (09.11.2006 16:15:18)  [18]

Ты копиратором работаешь?
Не мог дать ссылку на статью?


 
kyn66 ©   (2006-11-09 16:38) [22]

Дасс... наезды справедливы. Только не нужно думать про всех, что они сидят на выделенках с хорошим каналом и ежеминутно в форум заглядывают.  Кстати, писав ранее снат на Brodcast , все было нормально, если программу каждый запускает со своего рабочего места. Ща пробывал положить на сервак - отклик после мессаги идет трижды. Чтобы это значило?


 
novill ©   (2006-11-09 16:40) [23]

> [21] Anatoly Podgoretsky ©   (09.11.06 16:33)
> > novill  (09.11.2006 16:15:18)  [18]
>
> Ты копиратором работаешь?
> Не мог дать ссылку на статью?


Думаешь такую ссылку поняли бы ?

ms-help://MS.MSDNQTR.2004JUL.1033/netmgmt/netmgmt/netfileenum.htm


 
Ketmar ©   (2006-11-09 16:48) [24]

>[22] kyn66(c) 9-Nov-2006, 16:38
>Чтобы это значило?
что тема не для этой ветки. и вопрос задан... как бы тебе помягче... в очень провокативной форме он задан.


 
Vovan69   (2006-11-09 17:13) [25]

novill ©   (09.11.06 16:15) [18]

Супер :)

Jeer ©   (09.11.06 16:16) [19]

>Что-то развелось нумерных кунов и вованов.
> Это номер релиза, апгрейда ?

Не угадал. Года рождения. Слабо? :)


 
Jeer ©   (2006-11-09 17:21) [26]

Это где ж вы "нумерные" столько лет отсиживались ?
Что еще пропустили ?


 
Vovan69   (2006-11-09 17:29) [27]

Jeer ©   (09.11.06 17:21) [26]

Каждому - своё.


 
Ketmar ©   (2006-11-09 17:47) [28]

>[26] Jeer(c) 9-Nov-2006, 17:21
>Это где ж вы "нумерные" столько лет отсиживались ?
в госконторах, наверное.


 
Anatoly Podgoretsky ©   (2006-11-09 18:50) [29]

> Vovan69  (09.11.2006 17:13:25)  [25]

Учите английский - релиз это дата рождения


 
Anatoly Podgoretsky ©   (2006-11-09 18:51) [30]

> Vovan69  (09.11.2006 17:13:25)  [25]

А апгрейд наступят когда кое что начистят.



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

Форум: "Начинающим";
Текущий архив: 2006.11.26;
Скачать: [xml.tar.bz2];

Наверх





Память: 0.53 MB
Время: 0.089 c
2-1162811723
Khabibulin
2006-11-06 14:15
2006.11.26
Нарисовать треугольник в Pascal е


15-1162931282
Ice
2006-11-07 23:28
2006.11.26
Помогите потестить программу.


2-1162903592
tvv
2006-11-07 15:46
2006.11.26
Система


15-1162891139
Dush
2006-11-07 12:18
2006.11.26
Правильный "About"


2-1163002693
ApplyUpdates
2006-11-08 19:18
2006.11.26
Проблемы с ApplyUpdates





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
Английский Французский Немецкий Итальянский Португальский Русский Испанский