Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

Need CodeDom builder tutorial.

I have searched a lot on google, and using the hackforums search function, like i know you will all tell me to do, but i have just come up with a lot of errors or just dont understand it.

Could someone walk me through a codedom compiling example with string replacement within the stub located in the resources? Or, link me to a working and usable example that i could learn from? thanks.
(Aug 17, 2014 08:45 AM)Voidlight Wrote:  I have searched a lot on google, and using the hackforums search function, like i know you will all tell me to do, but i have just come up with a lot of errors or just dont understand it.

Could someone walk me through a codedom compiling example with string replacement within the stub located in the resources? Or, link me to a working and usable example that i could learn from? thanks.

Qeustion is, at what level are ya, plain said, what do you know.
I'll give you mine, editing this shortly.

Code
Private Sub CompileApp(ByVal filename As String)
      Dim provider As CodeDomProvider = CodeDomProvider.CreateProvider("VisualBasic")

      Dim parameters As New System.CodeDom.Compiler.CompilerParameters()
      ' Add reference
      parameters.ReferencedAssemblies.Add("System.dll")
      parameters.ReferencedAssemblies.Add("System.Windows.Forms.dll")
      parameters.ReferencedAssemblies.Add("Microsoft.VisualBasic.dll")
      parameters.ReferencedAssemblies.Add("System.Drawing.dll")

      'Compile in memory
      parameters.GenerateExecutable = True
      parameters.OutputAssembly = filename
      parameters.CompilerOptions = "/target:winexe"

      Dim strCode As String = "Your Code here"
      Dim CompileResults As New System.CodeDom.Compiler.CompilerResults(Nothing)

      CompileResults = provider.CompileAssemblyFromSource(parameters, strCode)

      If CompileResults.Errors.HasErrors Then
      ' If an error occurs
      MessageBox.Show("Error: Line>" & CompileResults.Errors(0).Line.ToString & ", " & _
      CompileResults.Errors(0).ErrorText)
      End If

    End Sub

Found this, hope it helps. It's from a working example i got here laying...
i think its well explained
https://hackforums.net/showthread.php?tid=3757923
https://hackforums.net/showthread.php?tid=3579582
Any more? those where not very successful..
http://msdn.microsoft.com/en-us//library....110).aspx

Regards,
(Aug 25, 2014 06:51 AM)RKYDA Wrote:  http://msdn.microsoft.com/en-us//library....110).aspx

Regards,

Could you give a quick example using that?
(Aug 25, 2014 08:22 AM)Voidlight Wrote:  Could you give a quick example using that?

I wish I could, but I dropped my spoon and it's dirty now.
[Image: giphy.gif?cid=790b7611b007c1bdd2cd47171b...y.gif&ct=g]
(Aug 25, 2014 03:00 PM)Tostig Wrote:  I wish I could, but I dropped my spoon and it's dirty now.

A little dirt never hurt anyone, spoon feed away.
(Aug 25, 2014 08:38 PM)Voidlight Wrote:  A little dirt never hurt anyone, spoon feed away.

How about stop being a skid & trying to copy-paste other people's code. Many people have linked you to great resources. Use them.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[C] by stdioMar 4, 2016 12:22 PM 34 4,785 Mar 4, 2016 12:22 PM
Last Post: Russ.
[.NET] by Slavoj ŽižekJun 17, 2015 01:00 AM 13 1,212 Jun 17, 2015 01:00 AM
Last Post: ShittyAdvice
[.NET] by MR FRODONov 22, 2014 08:51 AM 34 4,341 Nov 22, 2014 08:51 AM
Last Post: MickyCOB