No navigation frame on the left?  Click here.

Network

 

All but two of these samples demonstrate Net*() functions, which are not as obsolete as you might think (or as Microsoft would like them to be).

Are you trying to call Net*() functions on Win9X? Read this first! Afterwards, don't forget to check out the details (and samples!) here.

Here are a few points to ponder, all for the NT version of the Net*() APIs:

bulletOn Windows NT, all strings that you pass into or get from Net*() functions are Unicode, no matter what the docs or headers say. This means you may even have to do some creative casting.
bulletIf you need to work with domain accounts, use NetGetAnyDCName() to find a domain controller. Use the returned name as the servername argument (usually the first arg in any Net*() function). If you need to _set_ information for a domain account, you must talk to the primary domain controller. You can use NetGetDCName() to get the PDC's name.
bulletMany of the information-returning functions want a void ** or an LPBYTE *. For these, declare a vanilla pointer and set it to NULL before the call. Don't forget to use NetApiBufferFree() afterwards:
    BYTE *p;
    p = NULL;
    Net...( ..., &p, ... );
    // process results
    if ( p != NULL )
        NetApiBufferFree( p );

And now, the samples:

bulletNetAlertRaiseEx
bulletNetConnectionEnum
bulletNetEnumerateTrustedDomains
bulletNetFileEnum
bulletNetGroupEnum -- runs on NT and 95/98
bulletNetLocalGroupGetMembers
bulletNetLocalGroupsEnum
bulletNetMessageBufferSend
bulletNetRemoteTOD
bulletNetScheduleJobAdd and NetScheduleJobEnum
bulletNetServerEnum
bulletNetServerDiskEnum
bulletNetServerTransportEnum
bulletNetSessionDel, a working utility
bulletNetSessionEnum
bulletAnother NetSessionEnum sample -- runs on NT and 95/98 (and was updated on 23 Jan 99)!
bulletNetShareCheck
bulletNetShareEnum
bulletNetShareGetInfo
bulletNetUseAdd, NetUseEnum, and NetUseDel
bulletNetUserChangePassword and NetUserSetInfo
bulletNetUserEnum and NetQueryDisplayInformation
bulletNetUserGetGroups and NetUserGetLocalGroups
bulletNetUserGetInfo
bulletNetUserSetGroups
bulletSNMP Extension Agents (ARP, routing tables, NIC info etc.)
bulletSockets over IOCPs
bulletWNetOpenEnum and WNetEnumResources