NetShareAdd()函数在XP里创建共享啊,shi2_permissions 就是它的参数的一部分上面那东西看不清的我想也不太可能能解决我的问题了 :P

解决方案 »

  1.   

    share-level security是指win98,win98下的情况,用户都在工作组中,目录或打印机一旦共享,就可以被统一子网内任何机器访问(如果密码正确的话)
    与之相对应的是user-level security,用户在域模型中的情况(winnt,win2000),如果共享的话,只可以被授权用户访问,这是一种比较严格的安全机制。
    winXP我不是很熟悉,但我想他应该是User-level security.他的一些API可能相对于Win98,win2000,winnt有很大的不同,这一点你也要考虑到。建议你去查www.microsoft.com上最新的MSDN文档资料,应该会有所收获
      

  2.   

    NetShareAdd()我说的那个参数就是用在2000/XP的,就是没法用share-level
      

  3.   

    看了一下MSDN
    The NetShareSetInfo function sets the parameters of a shared resource.就是你说的Shared Level Security
    NetShareAdd的level参数,要启动必须用NetShareSetInfo来启用它。
    level 
    [in] Specifies the information level of the data. This parameter can be one of the following values. 
    Windows NT/2000 or later: The following levels are valid. Value Meaning 
    2 Specifies information about the shared resource, including name of the resource, type and permissions, and number of connections. The buf parameter points to a SHARE_INFO_2 structure. 
    502 Specifies information about the shared resource, including name of the resource, type and permissions, number of connections, and other pertinent information. The buf parameter points to a SHARE_INFO_502 structure. 你可以用NetShareSetInfo第三个参数设置2或者502
    不知道你是不是已经这么做的,我不太懂这个。
      

  4.   

    这个我倒没试过,NetShareAdd()里就有那个level参数的没办法,只有用NetShareSetInfo()试试了