99偷拍视频精品区一区二,口述久久久久久久久久久久,国产精品夫妇激情啪发布,成人永久免费网站在线观看,国产精品高清免费在线,青青草在线观看视频观看,久久久久久国产一区,天天婷婷久久18禁,日韩动漫av在线播放直播

VB.NET如何自定義屬性

這篇文章主要介紹了VB.NET如何自定義屬性,具有一定借鑒價值,感興趣的朋友可以參考下,希望大家閱讀完這篇文章之后大有收獲,下面讓小編帶著大家一起了解一下。

樂亭網站建設公司創新互聯,樂亭網站設計制作,有大型網站制作公司豐富經驗。已為樂亭上1000家提供企業網站建設服務。企業網站搭建\外貿網站建設要多少錢,請找那個售后服務好的樂亭做網站的公司定做!

類文件:(Class1)

  1. Imports System   

  2. Imports System.Reflection   

  3. < AttributeUsage(AttributeTargets.
    All, AllowMultiple:=True, 
    Inherited:=True)> _   

  4. Public Class Class1   

  5. Inherits System.Attribute   

  6. Private FamilyName As String   

  7. Private GivenName As String   

  8. Public Sub New(ByVal Family
    Name As String)   

  9. Me.FamilyName = FamilyName   

  10. End Sub   

  11. Public Overrides Function 
    ToString() As String   

  12. Return String.Format("Author:
    {0}{1}", FamilyName, GivenName)   

  13. End Function   

  14. Public Property Family() As String   

  15. Get   

  16. Return FamilyName   

  17. End Get   

  18. Set(ByVal Value As String)   

  19. FamilyName = Value   

  20. End Set   

  21. End Property   

  22. Public Property Given() As String   

  23. Get   

  24. Return GivenName   

  25. End Get   

  26. Set(ByVal Value As String)   

  27. GivenName = Value   

  28. End Set   

  29. End Property   

  30. End Class  

使用VB.NET自定義屬性的文件(Form3.VB)

  1. < Class1("Watkins", Given:="Damien"), 
    Class1("Abrams")> _   

  2. Public Class Form3   

  3. Inherits System.Windows.Forms.Form   

  4. Private Sub Button1_Click(ByVal sender 
    As System.Object, ByVal e As System.
    EventArgs) Handles Button1.Click   

  5. Dim t As TypeType = Type.GetType
    ("WindowsApplication6.Form3")   

  6. Dim attributes As Object() = 
    t.GetCustomAttributes(True)   

  7. Console.WriteLine("Custom 
    Attributes are: ")   

  8. For Each o As Object 
    In attributes   

  9. Console.WriteLine(o)   

  10. Next   

  11. End Sub   

  12. End Class  

感謝你能夠認真閱讀完這篇文章,希望小編分享的“VB.NET如何自定義屬性”這篇文章對大家有幫助,同時也希望大家多多支持創新互聯,關注創新互聯行業資訊頻道,更多相關知識等著你來學習!

標題名稱:VB.NET如何自定義屬性
文章URL:http://www.yijiale78.com/article36/jjpipg.html

成都網站建設公司_創新互聯,為您提供小程序開發網站營銷網站收錄服務器托管手機網站建設網站設計

廣告

聲明:本網站發布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網站立場,如需處理請聯系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經允許不得轉載,或轉載時需注明來源: 創新互聯

成都seo排名網站優化