Click or drag to resize

Functions.ANetResources Method

-- todo --
Places the names of network shares or printers into an array and then returns the number of resources.

Namespace:  XSharp.VFP
Assembly:  XSharp.VFP (in XSharp.VFP.dll) Version: 2.18
 FUNCTION ANetResources(
Request Example View Source


ArrayName (Optional)
Type: Usual
Specifies the name of the array containing the network share or printer information.
cNetworkName (Optional)
Type: Usual
Specifies the name of the network or domain for which share or printer information is returned.
nResourceType (Optional)
Type: Usual
Specifies the type of network resource for which information is returned.

Return Value

Type: Usual
If the array you specify doesn't exist, X# automatically creates the array. If the array exists and isn't large enough to contain all the information, X# automatically increases the size of the array to accommodate the information. If the array is larger than necessary, X# truncates the array.
If the array exists and ANetResources( ) returns 0 because no network shares or printers are found, the array remains unchanged. If the array doesn't exist and ANetResources( ) returns 0, the array isn't created.
The network name should be in the format "\\NetworkName." You do not have to be connected to the network you specify, and specifying a network doesn't connect you to the network. If you specify a domain name, ANetResources( ) returns an array of members or resources from that domain.
The names of shares on the network are returned if nResourceType evaluates to 1. The names of printers on the network are returned if nResourceType evaluates to 2. A value of 0 returns the name of any resource.
ANetResources( ) returns the number of network shares or printers found (identical to the number of rows in the array). ANetResources( ) returns zero if there are no shares or printers for the network of the type you specify, or the network you specify doesn't exist.
Before Windows 2000, share names were limited to twelve characters in length. If you run ANetResources() on a computer that uses an operating system earlier than Windows 2000, ANetResources() will not return any shares that are on computers running Windows 2000 or later that have share names longer than twelve characters.
Refer to the WNetOpenEnum and WNetEnumResource Win32 API functions for more details.
See Also