日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
VB.NET實例教程對關(guān)于Array問題的解決

在VB.NET中大家有沒有遇到過有關(guān)于Array的問題,VB.NET實例教程教你如何解決這個問題,大家快來嘗試一下吧。

成都創(chuàng)新互聯(lián),為您提供成都網(wǎng)站建設(shè)、重慶網(wǎng)站制作、網(wǎng)站營銷推廣、網(wǎng)站開發(fā)設(shè)計,對服務(wù)成都除甲醛等多個行業(yè)擁有豐富的網(wǎng)站建設(shè)及推廣經(jīng)驗。成都創(chuàng)新互聯(lián)網(wǎng)站建設(shè)公司成立于2013年,提供專業(yè)網(wǎng)站制作報價服務(wù),我們深知市場的競爭激烈,認真對待每位客戶,為客戶提供賞心悅目的作品。 與客戶共同發(fā)展進步,是我們永遠的責(zé)任!

VB.NET實例教程Array案例:

本實例需要項目引用:

 
 
 
  1. Imports Microsoft.Win32  '用途 : 注冊表操作  
  2. Imports System.Security.AccessControl'用途 : 訪問權(quán)限控制  

首先,對注冊表的鍵增加權(quán)限,細分起來共有11種可選的權(quán)限類型,它們對應(yīng)的參數(shù)如下:

 
 
 
  1. Select Case ComboBox1.Text  
  2. Case "完全控制"  
  3. ObjRegRight = RegistryRights.FullControl  
  4. Case "查詢數(shù)值"  
  5. ObjRegRight = RegistryRights.QueryValues  
  6. Case "設(shè)置數(shù)值"  
  7. ObjRegRight = RegistryRights.SetValue  
  8. Case "創(chuàng)建子項"  
  9. ObjRegRight = RegistryRights.CreateSubKey  
  10. Case "枚舉子項"  
  11. ObjRegRight = RegistryRights.EnumerateSubKeys  
  12. Case "通知"  
  13. ObjRegRight = RegistryRights.Notify  
  14. Case "創(chuàng)建鏈接"  
  15. ObjRegRight = RegistryRights.CreateLink  
  16. Case "刪除"  
  17. ObjRegRight = RegistryRights.Delete   
  18. Case "寫入DAC"  
  19. ObjRegRight = RegistryRights.WriteKey  
  20. Case "寫入所有者"  
  21. ObjRegRight = RegistryRights.TakeOwnership  
  22. Case "讀取控制"  
  23. ObjRegRight = RegistryRights.ReadPermissions  
  24. End Select 

而每個細分權(quán)限 又分"允許"和"拒絕"兩種訪問控制類型

 
 
 
  1. Select Case ComboBox2.Text  
  2. Case "允許"  
  3. ObjRegAccess = AccessControlType.Allow  
  4. Case "拒絕"  
  5. ObjRegAccess = AccessControlType.Deny  
  6. End Select 

以下為增加注冊表鍵權(quán)限的函數(shù)

以下兩函數(shù)中 Account代表系統(tǒng)nt帳戶  Rights和ControlType分別為上文提及的權(quán)限類型和訪問控制類型

 
 
 
  1. Private Sub AddRegistrySecurity(ByVal Str_FileName As String, ByVal Account As String, ByVal Rights As RegistryRights, ByVal ControlType As AccessControlType)  
  2. Dim RegKey As RegistryRegistryKey = Registry.CurrentUser.CreateSubKey("此處填寫具體鍵地址")  
  3. Dim RegkeyAcl As RegistrySecurity = RegKey.GetAccessControl()  
  4. Dim AccessRule As RegistryAccessRule = New RegistryAccessRule(Account, Rights, ControlType)  
  5. RegkeyAcl.AddAccessRule(AccessRule)  
  6. RegKey.SetAccessControl(RegkeyAcl)  
  7. RegKey.Close()  
  8. End Sub 

以下為移除注冊表鍵權(quán)限的函數(shù)

 
 
 
  1. Private Sub RemoveRegistrySecurity(ByVal Str_FileName As String, ByVal Account As String, ByVal Rights As RegistryRights, ByVal ControlType As AccessControlType)  
  2. Dim RegKey As RegistryRegistryKey = Registry.CurrentUser.CreateSubKey("此處填寫具體鍵地址")  
  3. Dim RegkeyAcl As RegistrySecurity = RegKey.GetAccessControl()  
  4. Dim AccessRule As RegistryAccessRule = New RegistryAccessRule(Account, Rights, ControlType)  
  5. RegkeyAcl.RemoveAccessRule(AccessRule)  
  6. RegKey.SetAccessControl(RegkeyAcl)  
  7. RegKey.Close()  
  8. End Sub 

VB.NET實例教程建議大家在做注冊表編程調(diào)試的時候,采用虛擬機調(diào)試 或者備份好本機資料,注冊表一旦破壞或者修改不當可能導(dǎo)致系統(tǒng)崩潰,切記!


分享標題:VB.NET實例教程對關(guān)于Array問題的解決
地址分享:http://m.5511xx.com/article/dpejpio.html