小男孩‘自慰网亚洲一区二区,亚洲一级在线播放毛片,亚洲中文字幕av每天更新,黄aⅴ永久免费无码,91成人午夜在线精品,色网站免费在线观看,亚洲欧洲wwwww在线观看

分享

用代碼實(shí)現(xiàn)對文件夾權(quán)限的控制

 zqx1000 2006-11-15
調(diào)用CACLS.EXE程序 
Public   Function   DelFolderUser(ByVal   path   As   String,   ByVal   UserName   As   String)  
                  If   path.EndsWith("\")   Then   path   =   path.Substring(0,   path.Length   -   1)  
                  Dim   CmdTxt   As   String  
                  CmdTxt   =   syspath   &   "Cacls.exe   "   &   path   &   "   /c   /e   /t   /r   "   &   UserName  
                  Shell(CmdTxt,   vbHide)  
                  Return   True  
          End   Function  
          Public   Function   SetFolderUser(ByVal   PathName   As   String,   ByVal   UserFlag   As   String,   ByVal   replace   As   Boolean)   As   Boolean  
                  ‘Set   Change   Permissions   for   the   developer   using   CACLS.exe  
                  If   PathName.EndsWith("\")   And   PathName.Length   >   3   Then   PathName   =   PathName.Substring(0,   PathName.Length   -   1).Trim  
                  ‘   PathName   =   PathName   &   "\"  
                  Dim   strACLCommand   As   String,   objRTC  
                  strACLCommand   =   "   /c   echo   y|"   &   syspath   &   "Cacls.exe   "  
                  strACLCommand   =   strACLCommand   &   PathName  
                  If   replace   Then  
                          strACLCommand   =   strACLCommand   &   "   /c   /t   /g   "   &   UserFlag  
                  Else  
                          strACLCommand   =   strACLCommand   &   "   /c   /e   /t   /g   "   &   UserFlag  
                  End   If  
                  Dim   objWSH  
                  ‘Set   objWSH   =   Server.CreateObject("WScript.Shell")  
                  ‘objRTC   =   objWSH.Run(strACLCommand,   0,   True)  
                  ‘MsgBox(strACLCommand)  
                  Dim   INF   As   ProcessStartInfo   =   New   ProcessStartInfo  
                  INF.FileName   =   syspath   &   "cmd.exe   "  
                  INF.Arguments   =   strACLCommand  
                  INF.WindowStyle   =   ProcessWindowStyle.Hidden  
                  Dim   bb   As   System.Diagnostics.Process   =   System.Diagnostics.Process.Start(INF)  
                  bb.WaitForExit()  
                  bb.Close()  
                  ‘   Shell(strACLCommand,   vbHide)  
                  ‘Set   objWSH   =   Nothing  
                  Return   True  
          End   Function

    本站是提供個(gè)人知識管理的網(wǎng)絡(luò)存儲空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約

    類似文章 更多