Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ---make.bat---
- @echo off
- for /f "usebackq" %%d in (`dir/w %WINDIR%\Microsoft.NET\Framework ^| findstr [v`) do set dotnetdir=%%d
- set dotnetdir=%dotnetdir:[=%
- set dotnetdir=%dotnetdir:]=%
- rem echo %dotnetdir%
- set CSCOMPILER=%windir%\Microsoft.NET\Framework\%dotnetdir%\csc.exe
- %CSCOMPILER% /target:winexe /main:App /platform:anycpu /out:skeleton.exe Main.cs Form1.cs
- pause
- ---end make.bat---
- ---Main.cs---
- using System;
- using System.Windows.Forms;
- class App
- {
- [STAThread]
- static void Main()
- {
- Application.EnableVisualStyles();
- Application.Run(new Form1());
- }
- }
- ---end Main.cs---
- ---Form1.cs---
- using System;
- using System.Windows.Forms;
- class Form1 : Form
- {
- static Button Button1;
- public Form1()
- {
- Button1 = new Button();
- Button1.Top = 10;
- Button1.Left = 10;
- Button1.Text = "hello";
- Button1.Click += new EventHandler(Button1_Click);
- this.Controls.Add(Button1);
- }
- private void Button1_Click(object sender, System.EventArgs e)
- {
- MessageBox.Show("hello");
- }
- }
- ---end Form1.cs---
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement