zoukankan      html  css  js  c++  java
  • 枚举共享目录

    #include <windows.h>
    #include <stdio.h>
    #include <lm.h>

    void main( int argc, CHAR *lpszArgv[ ])
    {

    PSHARE_INFO_502 BufPtr,p;
    NET_API_STATUS res;
    //LPTSTR   lpszServer = NULL;
    DWORD er=0,tr=0,resume=0, i;

       do // begin do
       {
          res = NetShareEnum (NULL, 502, (LPBYTE *)&BufPtr, -1, &er, &tr, &resume);
          //
          // If the call succeeds,
          //
          if(res == ERROR_SUCCESS || res == ERROR_MORE_DATA)
          {
             p=BufPtr;

             for(i=1;i<=er;i++)
             {
                printf("%S\n",p->shi502_path);
                p++;
             }
            
             NetApiBufferFree(BufPtr);
          }
          else
             printf("Error: %ld\n",res);
       }while (res==ERROR_MORE_DATA); // end do
      
       return;

    }

  • 相关阅读:
    Set,List,Map的区别
    阅读笔记15
    阅读笔记14
    阅读笔记13
    阅读笔记12
    阅读笔记11
    阅读笔记10
    架构漫谈读后感
    阅读笔记1
    暑期周记8
  • 原文地址:https://www.cnblogs.com/ahuo/p/924377.html
Copyright © 2011-2022 走看看