_WinNet_AddConnection3
Connects a local device to a network resource
#include <WinNet.au3>
_WinNet_AddConnection3($hWnd, $sLocalName, $sRemoteName [, $sUserName = 0 [, $sPassword = 0 [, $iType = 1 [, $iOptions = 1]]]])
Параметры
$hWnd | Handle to a window that the provider of network resources can use as an owner window for dialogs. Use this parameter if you set bit 2 (interactive) in the Options parameter. This parameter can be 0. |
$sLocalName |
Name of a local device to be redirected, such as "F:" or "LPT1". The string is treated in a case-insensitive manner. If 0, a connection to the network resource is made without redirecting the local device. |
$sRemoteName |
Name of the network resource to connect to |
$sUsername |
[необязательный] User name for making the connection. If 0, the function uses the default user name. |
$sPassword |
[необязательный] Password to be used to make a connection. If 0, the default password is used. If the string is empty, no password is used. |
$iType |
[необязательный] Specifies the type of network resource to connect to: 0 - Any (only if $sLocalName is 0) 1 - Disk 2 - Print |
$iOptions |
[необязательный] Connection options. Can be one or more of the following: 1 - The network resource connection should be remembered 2 - The operating system may interact with the user for authentication purposes 4 - The system not to use any default setting for user names or passwords without offering the user the opportunity to supply an alternative. This flag is ignored unless bit 2 (interactive) is also set. 8 - Forces the redirection of a local device when making the connection 16 - The operating system prompts the user for authentication using the command line instead of a GUI. This flag is ignored unless bit 2 (interactive) is also set. 32 - If this bit is set, and the operating system prompts for a credential, the credential is saved by the credential manager. If the credential manager is disabled for the caller's logon session, or if the network provider does not support saving credentials, this flag is ignored. This flag is also ignored unless you set bit 5 (command line instead of GUI). |
Возвращаемое значение
Успех: | Возвращает True |
Ошибка: | Возвращает False |
См. также
_WinNet_AddConnection, _WinNet_AddConnection2См. также
Искать WNetAddConnection3 в библиотеке MSDN