![]() |
Модераторы: Daevaorn |
![]() ![]() ![]() |
|
VZ |
|
|||
Unregistered |
Как можно программно (в С++) открыть доступ к диску (папке) в win98 (НЕ NT!)?
Заранее спасибо! |
|||
|
||||
dim |
|
|||
Шустрый ![]() Профиль Группа: Участник Сообщений: 106 Регистрация: 24.12.2002 Репутация: нет Всего: нет |
См. функцию NetShareAdd().
--------------------
that's all |
|||
|
||||
VZ |
|
|||
Unregistered |
Смотрю.. и вижу, что:
NT/2000 - supported 95/98 - not supported ![]() |
|||
|
||||
Baa |
|
|||
![]() Эксперт ![]() ![]() ![]() ![]() Профиль Группа: Экс. модератор Сообщений: 2639 Регистрация: 12.4.2002 Где: Москва Репутация: 8 Всего: 12 |
Это ты наерно в Platform SDK сморишь?
Я вот в MSDN отчетливо вижу: Windows NT/2000/XP: Included in Windows NT 3.1 and later. Windows 95/98/Me: Included in Windows 95 and later. Header: Declared in Lmshare.h (Windows NT/2000/XP) or Svrapi.h (Windows 95/98/Me); include Lm.h (Windows NT/2000/XP). Library: Use Netapi32.lib (Windows NT/2000/XP) or Svrapi.lib (Windows 95/98/Me). -------------------- "Duty is everything; the greatest of joys, the deepest of sorrows" Aribeth de Tylmarande |
|||
|
||||
AntonSaburov |
|
|||
![]() Штурман ![]() ![]() ![]() ![]() Профиль Группа: Модератор Сообщений: 5658 Регистрация: 2.7.2002 Где: Санкт-Петербург Репутация: нет Всего: 118 |
Еще раз смотрим в MSDN и ... о, чудо
![]() Windows 95/98/Me: The following code sample demonstrates how to share a resource on the local computer with a call to the NetShareAdd function. The code sample specifies the share_info_50 structure and no password on the share. The sample also allocates and frees the memory required for the information buffer. #include <stdio.h> #include <windows.h> #include <svrapi.h> int main(int argc, char FAR * argv[]) { char FAR * pszServerName = NULL; short nLevel = 50; struct share_info_50* pBuf = NULL; unsigned short cbBuffer; NET_API_STATUS nStatus; // // ServerName can be NULL to indicate the local computer. // if ((argc < 3) || (argc > 4)) { printf("Usage: %s [\\\\ServerName] ShareName SharePath\n", argv[0]); exit(1); } if (argc == 4) pszServerName = argv[1]; // // Allocate the memory required to specify a // share_info_50 structure. // cbBuffer = sizeof(struct share_info_50); pBuf = malloc(cbBuffer); if (pBuf == NULL) printf("No memory\n"); // // Assign values to the share_info_50 structure. // strcpy(pBuf->shi50_netname, argv[argc-2]); pBuf->shi50_type = STYPE_DISKTREE; pBuf->shi50_flags = SHI50F_FULL; pBuf->shi50_remark = NULL; pBuf->shi50_path = argv[argc-1]; pBuf->shi50_rw_password[0] = '\0'; // No password pBuf->shi50_ro_password[0] = '\0'; // No password // // Call the NetShareAdd function // specifying information level 50. // nStatus = NetShareAdd(pszServerName, nLevel, (char FAR *)pBuf, cbBuffer); // // Display the result of the function call. // if (nStatus == NERR_Success) printf("Share added successfully\n"); else fprintf(stderr, "A system error has occurred: %d\n", nStatus); // // Free the allocated memory. // if (pBuf != NULL) free(pBuf); return 0; } |
|||
|
||||
VZ |
|
|||
Unregistered |
СПАСИБО!
|
|||
|
||||
![]() ![]() ![]() |
Правила форума "С++:Общие вопросы" | |
|
Добро пожаловать!
Если Вам понравилась атмосфера форума, заходите к нам чаще! С уважением, Earnest Daevaorn |
0 Пользователей читают эту тему (0 Гостей и 0 Скрытых Пользователей) | |
0 Пользователей: | |
« Предыдущая тема | C/C++: Общие вопросы | Следующая тема » |
|
По вопросам размещения рекламы пишите на vladimir(sobaka)vingrad.ru
Отказ от ответственности Powered by Invision Power Board(R) 1.3 © 2003 IPS, Inc. |