Using Win32 functions in Visual FoxPro Image Gallery
Network Management
..msdn
NetApiBufferFree
NetApiBufferSize
NetConnectionEnum
NetFileClose
NetFileEnum
NetFileGetInfo
NetGetDCName
NetGroupEnum
NetLocalGroupEnum
NetMessageBufferSend
NetMessageNameAdd
NetMessageNameDel
NetMessageNameEnum
NetScheduleJobAdd
NetScheduleJobDel
NetScheduleJobEnum
NetServerEnum
NetServerGetInfo
NetSessionEnum
NetShareAdd
NetShareDel
NetShareEnum
NetShareSetInfo
NetUserAdd
NetUserChangePassword
NetUserDel
NetUserEnum
NetUserGetGroups
NetUserGetInfo
NetUserGetLocalGroups
NetUserSetInfo
NetWkstaGetInfo
NetWkstaTransportEnum
NetWkstaUserEnum
Code examples:
How to enumerate, add and delete shares on the local computer (WinNT/XP)
How to enumerate, add and delete shares on the local computer (WinNT/XP)

User rating: 0/10 (0 votes)
Rate this code sample:
  • ~
More code examples    Listed functions    Add comment     W32 Constants      Translate this page Printer friendly version of this code sample
Versions:
click to open
Before you begin:
This code sample presents the SharedResources class that encapsulates a collection of the SHARE_INFO_2 objects.

Note that all NetShare API calls require Unicode string parameters.

Use the following code to test the SharedResources class:

LOCAL oShares As SharedResources, oShare As Share_Info_2
oShares = CREATEOBJECT("SharedResources") && local computer

FOR EACH oShare IN oShares.shares
        IF oShare.sharetype=0 && disk drive
                ? FromUnicode(oShare.sharename) + "=" +;
                        FromUnicode(oShare.localpath)
        ENDIF
NEXT

See also:

  • Enumerating network resources
  • Mapping and disconnecting network drives in FoxPro application
  • Retrieving lists of servers of the specified type visible in the primary domain (WinNT/2K)
  • Enumerating sessions established on a server

  •  
      Members area. Log in to view this example.
     
      User name:
      Password:
     
     
      Forgot your password?
     
      Sign up for
    the Membership
     
     


    User rating: 0/10 (0 votes)
    Rate this code sample:
    • ~
    8664 bytes  
    Created: 2002-12-17 19:43:04  
    Modified: 2011-12-10 09:20:22  
    Visits in 7 days: 181  
    Listed functions:
    GlobalAlloc
    GlobalFree
    GlobalSize
    NetApiBufferFree
    NetApiBufferSize
    NetShareAdd
    NetShareDel
    NetShareEnum
    NetShareSetInfo
    Printer friendly API declarations
    My comment:
    Code rewritten: Dec.2, 2005

    Administrator, Power User, Print Operator, or Server Operator group membership is required to successfully execute the NetShareEnum function at levels 2 and 502.

    The ANETRESOURCES( ) function places the names of network shares or printers into an array and then returns the number of resources.

    * * *


    Take a look at Scripts to manage Shared Folders on ActiveXperts Software.
    Word Index links for this example:
    Translate this page:
      Spanish    Portuguese    German    French    Italian  
    FreeTranslation.com offers instant, free translations of text or web pages.
    User Contributed Notes:
    There are no notes on this subject.


    Copyright © 2001-2013 News2News, Inc. Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use. The information on this page is presented AS IS, meaning that you may use it at your own risk. Microsoft Visual FoxPro and Windows are trade marks of Microsoft Corp. All other trademarks are the property of their respective owners. 

    Privacy policy
    Credits: PHP (4.4.9), an HTML-embedded scripting language, MySQL (5.1.55-log), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
    Last Topics Visited (184.73.74.47)
    1.73 hrs.Example: 'GDI+: Creating thumbnails to preview images in a directory'
     Function: 'CryptDestroyKey'
    13.22 hrs.Example: 'Pocket PC: Folder Viewer'
     Example: 'How to retrieve configuration data for a specified printer stored in the registry (PrinterDriverData key)'
    18.96 hrs.Example: 'How to print FoxPro form'
     Example: 'Reading VFP settings from the Windows Registry'
    20.42 hrs.Example: 'Using FlashWindowEx to flash the taskbar button of the VFP application'
     Example: 'Running a regular FoxPro form while main VFP window is minimized'
    20.99 hrs.Example: 'How to display the port-configuration dialog box for a port on the specified server'
    22.27 hrs.Example: 'Drawing Windows predefined bitmaps using the LoadBitmap functions'
    Google
    Advertise here!