本文整理匯總了VB.NET中System.CodeDom.Compiler.CompilerResults類的典型用法代碼示例。如果您正苦於以下問題:VB.NET CompilerResults類的具體用法?VB.NET CompilerResults怎麽用?VB.NET CompilerResults使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了CompilerResults類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: DisplayCompilerResults
' 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