CompilerResults クラスとは? わかりやすく解説

CompilerResults クラス

コンパイラから返されるコンパイル結果表します

名前空間: System.CodeDom.Compiler
アセンブリ: System (system.dll 内)
構文構文

<SerializableAttribute> _
Public Class CompilerResults
Dim instance As CompilerResults
[SerializableAttribute] 
public class CompilerResults
[SerializableAttribute] 
public ref class CompilerResults
/** @attribute SerializableAttribute() */ 
public class CompilerResults
SerializableAttribute 
public class CompilerResults
解説解説
使用例使用例
' Displays information from a CompilerResults.
Public Shared Sub DisplayCompilerResults(ByVal
 cr As System.CodeDom.Compiler.CompilerResults)
    ' If errors occurred during compilation, output the compiler output
 and errors.
    If cr.Errors.Count > 0 Then
        Dim i As Integer
        For i = 0 To cr.Output.Count - 1
            Console.WriteLine(cr.Output(i))
        Next i        
        For i = 0 To cr.Errors.Count - 1
            Console.WriteLine((i.ToString() + ": "
 + cr.Errors(i).ToString()))
        Next i
    Else
        ' Display information about the compiler's exit code and the
 generated assembly.
        Console.WriteLine(("Compiler returned with result code:
 " + cr.NativeCompilerReturnValue.ToString()))
        Console.WriteLine(("Generated assembly name: "
 + cr.CompiledAssembly.FullName))
        If cr.PathToAssembly Is Nothing
 Then
            Console.WriteLine("The assembly has been generated
 in memory.")
        Else
            Console.WriteLine(("Path to assembly: "
 + cr.PathToAssembly))
        End If
        ' Display temporary files information.
        If Not cr.TempFiles.KeepFiles Then
            Console.WriteLine("Temporary build files were deleted.")
        Else
            Console.WriteLine("Temporary build files were not
 deleted.")
            ' Display a list of the temporary build files
            Dim enu As IEnumerator = cr.TempFiles.GetEnumerator()
            Dim i As Integer
            i = 0
            While enu.MoveNext()
                Console.WriteLine(("TempFile " + i.ToString()
 + ": " + CStr(enu.Current)))
                i += 1
            End While
        End If
    End If
End Sub
// Displays information from a CompilerResults.
public static void DisplayCompilerResults(System.CodeDom.Compiler.CompilerResults
 cr)
{
    // If errors occurred during compilation, output the compiler output
 and errors.
    if( cr.Errors.Count > 0 )
    {
        for( int i=0; i<cr.Output.Count;
 i++ )                
            Console.WriteLine( cr.Output[i] );
        for( int i=0; i<cr.Errors.Count;
 i++ )                
            Console.WriteLine( i.ToString() + ": " + cr.Errors[i].ToString()
 );
        
    }
    else
    {
        // Display information about the compiler's exit code and the
 generated assembly.
        Console.WriteLine( "Compiler returned with result code: " + cr.NativeCompilerReturnValue.ToString()
 );
        Console.WriteLine( "Generated assembly name: " + cr.CompiledAssembly.FullName
 );
        if( cr.PathToAssembly == null )
            Console.WriteLine( "The assembly has been generated in
 memory." );
        else
            Console.WriteLine( "Path to assembly: " + cr.PathToAssembly
 );
        
        // Display temporary files information.
        if( !cr.TempFiles.KeepFiles )                
            Console.WriteLine( "Temporary build files were deleted." );
        else
        {
            Console.WriteLine( "Temporary build files were not deleted."
 );
            // Display a list of the temporary build files
            IEnumerator enu = cr.TempFiles.GetEnumerator();                     
                   
            for( int i=0; enu.MoveNext(); i++
 )                                          
                Console.WriteLine( "TempFile " + i.ToString() + ":
 " + (string)enu.Current );                  
        }
    }
}
// Displays information from a CompilerResults.
[PermissionSet(SecurityAction::Demand, Name="FullTrust")]
static void DisplayCompilerResults( System::CodeDom::Compiler::CompilerResults^
 cr )
{
   
   // If errors occurred during compilation, output the compiler output
 and errors.
   if ( cr->Errors->Count > 0 )
   {
      for ( int i = 0; i < cr->Output->Count;
 i++ )
         Console::WriteLine( cr->Output[ i ] );
      for ( int i = 0; i < cr->Errors->Count;
 i++ )
         Console::WriteLine( String::Concat( i, ": ", cr->Errors[ i
 ] ) );
   }
   else
   {
      
      // Display information ab->Item[Out] the* compiler's exit code
 and the generated assembly.
      Console::WriteLine( "Compiler returned with result code: {0}", cr->NativeCompilerReturnValue
 );
      Console::WriteLine( "Generated assembly name: {0}", cr->CompiledAssembly->FullName
 );
      if ( cr->PathToAssembly == nullptr )
               Console::WriteLine( "The assembly has been generated in
 memory." );
      else
               Console::WriteLine( "Path to assembly: {0}", cr->PathToAssembly
 );
      
      // Display temporary files information.
      if (  !cr->TempFiles->KeepFiles )
               Console::WriteLine( "Temporary build files were deleted."
 );
      else
      {
         Console::WriteLine( "Temporary build files were not deleted."
 );
         
         // Display a list of the temporary build files
         IEnumerator^ enu = cr->TempFiles->GetEnumerator();
         for ( int i = 0; enu->MoveNext();
 i++ )
            Console::WriteLine("TempFile " + i.ToString() + ": "
 + (String^)(enu->Current) );
      }
   }
}
.NET Framework のセキュリティ.NET Frameworkセキュリティ
継承階層継承階層
System.Object
  System.CodeDom.Compiler.CompilerResults
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバ場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
CompilerResults メンバ
System.CodeDom.Compiler 名前空間
ICodeCompiler



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「CompilerResults クラス」の関連用語

CompilerResults クラスのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



CompilerResults クラスのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.

©2024 GRAS Group, Inc.RSS