Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports Microsoft.CSharp
- Imports System.CodeDom.Compiler
- Imports System.Drawing
- Imports System.Diagnostics
- Namespace C
- Module Module1
- Dim parameters As New CompilerParameters()
- Sub Main()
- Dim Provider = CodeDomProvider.CreateProvider("CSharp")
- parameters.GenerateExecutable = True
- parameters.OutputAssembly = "Output.exe"
- Dim results As CompilerResults = Provider.CompileAssemblyFromSource(parameters, "N:/C#/Code.txt")
- If results.Errors.Count > 0 Then
- For Each Err As CompilerError In results.Errors
- MsgBox("Line number " & Err.Line & ", Error Number: " & Err.ErrorNumber & ", '" & Err.ErrorText + ";")
- Next
- Else
- MsgBox("Successful compile")
- Process.Start("Output.exe")
- End If
- End Sub
- End Module
- End Namespace
Advertisement
Add Comment
Please, Sign In to add comment