Nyelv

VBCodeProvider Konstruktorok

Definíció

Inicializálja a VBCodeProvider osztály új példányát.

Túlterhelések

Name Description
VBCodeProvider()

Inicializálja a VBCodeProvider osztály új példányát.

VBCodeProvider(IDictionary<String,String>)

Inicializálja az VBCodeProvider osztály új példányát a megadott szolgáltatói beállítások használatával.

VBCodeProvider()

Forrás:
VBCodeProvider.cs
Forrás:
VBCodeProvider.cs
Forrás:
VBCodeProvider.cs
Forrás:
VBCodeProvider.cs
Forrás:
VBCodeProvider.cs
Forrás:
VBCodeProvider.cs
Forrás:
VBCodeProvider.cs
Forrás:
VBCodeProvider.cs

Inicializálja a VBCodeProvider osztály új példányát.

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

A következőre érvényes:

VBCodeProvider(IDictionary<String,String>)

Forrás:
VBCodeProvider.cs
Forrás:
VBCodeProvider.cs
Forrás:
VBCodeProvider.cs
Forrás:
VBCodeProvider.cs
Forrás:
VBCodeProvider.cs
Forrás:
VBCodeProvider.cs
Forrás:
VBCodeProvider.cs
Forrás:
VBCodeProvider.cs

Inicializálja az VBCodeProvider osztály új példányát a megadott szolgáltatói beállítások használatával.

public:
 VBCodeProvider(System::Collections::Generic::IDictionary<System::String ^, System::String ^> ^ providerOptions);
public VBCodeProvider(System.Collections.Generic.IDictionary<string,string> providerOptions);
new Microsoft.VisualBasic.VBCodeProvider : System.Collections.Generic.IDictionary<string, string> -> Microsoft.VisualBasic.VBCodeProvider
Public Sub New (providerOptions As IDictionary(Of String, String))

Paraméterek

providerOptions
IDictionary<String,String>

A IDictionary<TKey,TValue> szolgáltatói beállításokat tartalmazó objektum.

Kivételek

providerOptions az null.

Példák

Az alábbi példa bemutatja, hogyan adhatja meg a fordítóverziót az VBCodeProvider osztály új példányának létrehozásakor.

Imports System.CodeDom.Compiler
Imports Microsoft.CSharp
Imports System.Collections.Generic



Class Program

    Shared Sub Main(ByVal args() As String)
        DisplayVBCompilerInfo()
        Console.WriteLine("Press Enter key to exit.")
        Console.ReadLine()

    End Sub

    Shared Sub DisplayVBCompilerInfo()
        Dim provOptions As New Dictionary(Of String, String)
        provOptions.Add("CompilerVersion", "v3.5")
        ' Get the provider for Microsoft.VisualBasic
        Dim vbProvider As VBCodeProvider = New VBCodeProvider(provOptions)

        ' Display the Visual Basic language provider information.
        Console.WriteLine("Visual Basic provider is {0}", vbProvider.ToString())
        Console.WriteLine("  Provider hash code:     {0}", vbProvider.GetHashCode().ToString())
        Console.WriteLine("  Default file extension: {0}", vbProvider.FileExtension)

        Console.WriteLine()

    End Sub
End Class

Megjegyzések

.NET Framework-alkalmazásokban a > elemből szerezheti be a értékét. A használni kívánt verzió VBCodeProvider azonosításához adja meg az elemet, adja meg a <providerOption> "CompilerVersion" nevet a beállításnévként, és adja meg a verziószámot (például "v3.5") beállításértékként. A verziószámot kisbetűs "v" betűvel kell megelőznie. Az alábbi konfigurációs példa bemutatja, hogyan adható meg, hogy a Visual Basic kódszolgáltató 3.5-ös verzióját kell használni.

<configuration>
  <system.codedom>
    <compilers>
      <!-- zero or more compiler elements -->
      <compiler
          language="vb;VisualBasic"
          extension=".vb"
          type="Microsoft.VisualBasic.VBCodeProvider, System,
          Version=2.0.3600.0, Culture=neutral,
          PublicKeyToken=b77a5c561934e089"
          compilerOptions="/optimize"
          warningLevel="1" >
          <providerOption
            name="CompilerVersion"
            value="v3.5" />
        </compiler>
    </compilers>
  </system.codedom>
</configuration>

Lásd még

A következőre érvényes: