国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 開發(fā) > 綜合 > 正文

目錄共享

2024-07-21 02:23:16
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友
  • 網(wǎng)站運(yùn)營(yíng)seo文章大全
  • 提供全面的站長(zhǎng)運(yùn)營(yíng)經(jīng)驗(yàn)及seo技術(shù)!
  • option explicit

    'netshareadd在win9x下是放在srvapi.dll中,而在nt下則入在netapi32.dll中。
    '
    '在win98下應(yīng)使用結(jié)構(gòu)share_info_50
    '在nt下應(yīng)使用結(jié)構(gòu)share_info_2 和share_info_502

    private declare function netshareadd lib "srvapi.dll" (byval servername as long, byval level as long, buf as any, parmerr as long) as long
    private type share_info_2
    shi2_netname as long '共享名
    shi2_type as long '類型
    shi2_remark as long '備注
    shi2_permissions as long '權(quán)限
    shi2_max_uses as long '最大用戶
    shi2_current_uses as long '
    shi2_path as long '路徑
    shi2_passwd as long '密碼
    end type

    const stype_all = -1
    const stype_disktree = 0
    const stype_printq = 1
    const stype_device = 2
    const stype_ipc = 3
    const stype_special = &h80000000

    const access_read = &h1
    const access_write = &h2
    const access_create = &h4
    const access_exec = &h8
    const access_delete = &h10
    const access_atrib = &h20
    const access_perm = &h40
    const access_all = access_read or access_write or access_create or access_exec or access_delete or access_atrib or access_perm

    '為指定的計(jì)算機(jī)添加共享
    'server 為計(jì)算機(jī)名
    'sharepath 為共享路徑
    'sharename 為共享名
    'shareremark 為備注
    'sharepw 為密碼
    function addshare(server as string, sharepath as string, sharename as string, shareremark as string, sharepw as string) as boolean
    dim lngserver as long
    dim lngnetname as long
    dim lngpath as long
    dim lngremark as long
    dim lngpw as long
    dim parmerr as long
    dim si2 as share_info_2

    lngserver = strptr(server)
    lngnetname = strptr(sharename)
    lngpath = strptr(sharepath)

    if len(shareremark) > 0 then
    lngremark = strptr(shareremark)
    end if

    if len(sharepw) > 0 then
    lngpw = strptr(sharepw)
    end if

    with si2
    .shi2_netname = lngnetname
    .shi2_path = lngpath
    .shi2_remark = lngremark
    .shi2_type = stype_disktree
    .shi2_permissions = access_all
    .shi2_max_uses = -1
    .shi2_passwd = lngpw
    end with

    if netshareadd(lngserver, 2, si2, parmerr) = 0 then
    addshare = true
    else
    addshare = false
    end if
    end function

    private sub command1_click()
    ' mkdir "d:/123"
    addshare "server", "d:/123", "123", "例子", ""
    end sub

    發(fā)表評(píng)論 共有條評(píng)論
    用戶名: 密碼:
    驗(yàn)證碼: 匿名發(fā)表
    主站蜘蛛池模板: 饶平县| 望都县| 巧家县| 桃江县| 桂林市| 双辽市| 包头市| 咸阳市| 江都市| 丽江市| 额敏县| 巴青县| 安平县| 宁安市| 霞浦县| 永德县| 通山县| 常州市| 汉阴县| 蕉岭县| 遂昌县| 长阳| 东方市| 长岭县| 南充市| 葵青区| 丹阳市| 仙居县| 洪泽县| 高碑店市| 阿克苏市| 离岛区| 朝阳区| 阳泉市| 汉沽区| 即墨市| 龙州县| 江津市| 会泽县| 山丹县| 德江县|