Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

[C#] Builder with no stub.

Name: Vengeance 2009-07-20 22:44


using System;
using System.Windows.Forms;
using System.Text;
using System.Reflection;
using Microsoft.CSharp;
using System.CodeDom.Compiler;

namespace Builder
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            StringBuilder strb = new StringBuilder();      
            strb.Append("using System;");                  
            strb.Append("using System.Windows.Forms;");
            strb.Append("public class main");
            strb.Append("{");
            strb.Append("public static void Main()");
            strb.Append("{");
            strb.Append("MessageBox.Show(\"");
            strb.Append(textBox1.Text);                    
            strb.Append("\");");
            strb.Append("}");
            strb.Append("}");
            string source = strb.ToString();               

            ICodeCompiler compiler = new CSharpCodeProvider().CreateCompiler();    
            CompilerParameters args = new CompilerParameters();
           
            args.CompilerOptions = "/target:winexe";
            args.OutputAssembly = "gay.exe";         //Name
            args.GenerateExecutable = true;
           
            foreach (Assembly asm in AppDomain.CurrentDomain.GetAssemblies())
            {
                args.ReferencedAssemblies.Add(asm.Location);
            }
           
            CompilerResults build = compiler.CompileAssemblyFromSource(args, source);
           
            foreach (CompilerError ce in build.Errors)                               
            {
                MessageBox.Show(ce.ErrorNumber + " " + ce.ErrorText);
            }
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }
       
    }
   
}


This is a very ghetto way of doing it, this was my attempt. D:

Name: Anonymous 2009-07-21 0:08

It wasn't bad when the framework was 500MB, so what do they do? Keep adding more. I think what Micro$oft doesn't understand is more is not always better. Having every function imaginable duplicated three times throughout the library, and them some more, is not how you make it easier for developers to use. The entire Java installer is smaller than a handful or UPDATES to .NET

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List