共用方式為


CompilerGlobalScopeAttribute 建構函式

定義

初始化 CompilerGlobalScopeAttribute 類別的新執行個體。

public:
 CompilerGlobalScopeAttribute();
public CompilerGlobalScopeAttribute ();
Public Sub New ()

範例

下列程式代碼範例示範如何套用 CompilerGlobalScopeAttribute

using System;
using System.Runtime.CompilerServices;

[CompilerGlobalScopeAttribute()]
class Program
{
    static void Main(string[] args)
    {
        Console.WriteLine("The attribute was applied.");
    }
}
Imports System.Runtime.CompilerServices

<CompilerGlobalScopeAttribute()> _
Module Program


    Sub Main(ByVal args() As String)
        Console.WriteLine("The attribute was applied.")
    End Sub


End Module

適用於