How to Creat an Exe With Visual basic 2014

12:46 PM Unknown 0 Comments

I think every programmer to create a program that generates executable,
Good with a Microsoft component that is possible, ie you add a TextBox1
And Compliar want the code that is in it. Good in VB . & CSharp net this is possible,
How to make a simple? Good It first few things before Nampspace

Code:
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using System.CodeDom.Compiler;
Now let's add some functions xD
Code:
public static bool Compliar (EXE_Nome string, string Source)
{
CodeDomProvider Compiler = CodeDomProvider.CreateProvider ("CSharp");
CompilerParameters CompilerParameters = new Parameters ();
CompilerResults cResults = default (CompilerResults);
Parameters.GenerateExecutable = true;
Parameters.OutputAssembly = EXE_Nome;
Parameters.ReferencedAssemblies.Add ("System.dll");
Parameters.ReferencedAssemblies.Add ("System.Data.dll");
Parameters.ReferencedAssemblies.Add ("System.Windows.Forms.dll");
Parameters.ReferencedAssemblies.Add ("System.Drawing.dll");
Parameters.ReferencedAssemblies.Add ("System.Xml.dll");
Parameters.CompilerOptions = "/ target: winexe";
Dictionary <string, string> Version = new Dictionary <string, string> ();
Parameters.TreatWarningsAsErrors = false;
if (! string.IsNullOrEmpty (Icon))
{
}
cResults = Compiler.CompileAssemblyFromSource (Parameters, Source);
if (cResults.Errors.Count> 0)
{
foreach (CompilerError CompilerError_loopVariable in cResults.Errors)
{
CompilerError error = CompilerError_loopVariable;
MessageBox.Show ("Error:" + error.ErrorText, "", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
return false;
}
else if (cResults.Errors.Count == 0)
{
MessageBox.Show ("Successful Program", "Correct");
return true;
}
return true;
}
? Using Good Leave a textBox: textBox1 Make a button: button1 poe the textBox the desired size two clickes the Button1 and Add:





Code:
  Compliar ("Aplicacao.exe" textBox1.text.toString);
Understanding the code above: Compliar: the function name (..): Among the parenthesis are the paramentros and variables used in the function"Aplicacao.exe": Was the nomedo exe files of application. textBox1.text.tostring: Would the code . you type in the TextBox, a ne pc prescisaria toString would not textBox1.Text direct test both xD xD Now, we only study to test the code to convert it to vb . NET If you do not have any code to use this test:






Code:
using System;
public class TGH
{
public static void Main ()
{
Console.WriteLine ("Hello Team Game Hacking!");
}
}
using System; class Program { static void Main () { Console.Write ("1") Console.Write ("2") Console.Write ("3"); Console.Read (); } } 









0 comments: