本文整理匯總了VB.NET中System.Runtime.CompilerServices.InternalsVisibleToAttribute.InternalsVisibleToAttribute構造函數的典型用法代碼示例。如果您正苦於以下問題:VB.NET InternalsVisibleToAttribute構造函數的具體用法?VB.NET InternalsVisibleToAttribute怎麽用?VB.NET InternalsVisibleToAttribute使用的例子?那麽, 這裏精選的構造函數代碼示例或許可以為您提供幫助。您也可以進一步了解該構造函數所在類System.Runtime.CompilerServices.InternalsVisibleToAttribute
的用法示例。
在下文中一共展示了InternalsVisibleToAttribute構造函數的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: AppendDirectorySeparator
'
' The source code should be saved in a file named Example1.cs. It
' can be compiled at the command line as follows:
'
' vbc Assembly1.vb /t:library /keyfile:<snkfilename>
'
' The public key of the Friend1 file should be changed to the full
' public key stored in your strong-named key file.
'
Imports System.IO
Imports System.Runtime.CompilerServices
<Assembly:InternalsVisibleTo("Friend1, PublicKey=002400000480000094" + _
"0000000602000000240000525341310004000" + _
"001000100bf8c25fcd44838d87e245ab35bf7" + _
"3ba2615707feea295709559b3de903fb95a93" + _
"3d2729967c3184a97d7b84c7547cd87e435b5" + _
"6bdf8621bcb62b59c00c88bd83aa62c4fcdd4" + _
"712da72eec2533dc00f8529c3a0bbb4103282" + _
"f0d894d5f34e9f0103c473dce9f4b457a5dee" + _
"fd8f920d8681ed6dfcb0a81e96bd9b176525a" + _
"26e0b3")>
Public Class FileUtilities
Friend Shared Function AppendDirectorySeparator(dir As String) As String
If Not dir.Trim().EndsWith(Path.DirectorySeparatorChar) Then
Return dir.Trim() + Path.DirectorySeparatorChar
Else
Return dir
End If
End Function
End Class
示例2: Main
'
' The source code should be saved in a file named Friend1.vb. It
' can be compiled at the command line as follows:
'
' vbc Friend1.vb /r:Assembly1.dll /keyfile:<snkfilename>
'
' The public key of the Friend1 assembly should correspond to the public key
' specified in the class constructor of the InternalsVisibleTo attribute in the
' Assembly1 assembly.
'
Module Example
Public Sub Main()
Dim dir As String = "C:\Program Files"
dir = FileUtilities.AppendDirectorySeparator(dir)
Console.WriteLine(dir)
End Sub
End Module
輸出:
C:\Program Files\
示例3: InternalsVisibleTo
' 導入命名空間
Imports System.Runtime.CompilerServices
<assembly: InternalsVisibleTo("Friend2")>
Namespace Utilities.StringUtilities
Public Class StringLib
Friend Shared Function IsFirstLetterUpperCase(s As String) As Boolean
Dim first As String = s.Substring(0, 1)
Return first = first.ToUpper()
End Function
End Class
End Namespace
示例4: Main
' 導入命名空間
Imports Utilities.StringUtilities
Module Example
Public Sub Main()
Dim s As String = "The Sign of the Four"
Console.WriteLine(StringLib.IsFirstLetterUpperCase(s))
End Sub
End Module