zoukankan      html  css  js  c++  java
  • VC共享文件夹

     1 BOOL NetShare(char * pShareName,char * pSharePath)
     2 {
     3     USES_CONVERSION;
     4     SHARE_INFO_502   si502;   
     5     NET_API_STATUS   nas;   
     6     LPWSTR pwShareName=A2W(pShareName);  //转换成unicode 字符串
     7     LPWSTR pwSharePath=A2W(pSharePath);
     8 
     9     si502.shi502_netname   =   (LPWSTR)pwShareName;   
    10     si502.shi502_type   =   STYPE_DISKTREE;   
    11     si502.shi502_remark   =   NULL;   
    12     si502.shi502_permissions   =   0;   
    13     si502.shi502_max_uses   =   /*SHI_USES_UNLIMITED*/1;   
    14     si502.shi502_current_uses   =   0;   
    15     si502.shi502_path   =   (LPWSTR)pwSharePath;   
    16     si502.shi502_passwd   =   NULL;   
    17     si502.shi502_reserved   =   0;   
    18     si502.shi502_security_descriptor   =   NULL   ;
    19 
    20         nas   =   NetShareAdd(   
    21         NULL,                   //   share   is   on   local   machine   
    22         502,                         //   info-level   
    23         (LPBYTE)&si502,   //   info-buffer   
    24         NULL                         //   don't   bother   with   parm   
    25         );     
    26 
    27     return (nas==0);
    28 }
    BOOL  NetShareStop(char * pShareName)
    {
    	USES_CONVERSION;
    	LPWSTR pwShareName=A2W(pShareName);
    
    	return NetShareDel( NULL,(LPWSTR)pwShareName,NULL);
    }
    
  • 相关阅读:
    shell 的多进程
    shell 按行读取文件的内容
    2>&1的意思
    >/dev/null 2>&1
    js 变量作用域
    Premiere Pro 中的键盘快捷键
    premiere pro 2019 mac 破解
    js 空语句
    js 数组原型
    js 奇偶判断
  • 原文地址:https://www.cnblogs.com/liuxupiaoshi/p/4239958.html
Copyright © 2011-2022 走看看