Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static class Program
- {
- [STAThread]
- static void Main(string[] args) {
- bool consoleMode = Boolean.Parse(args[0]);
- if (consoleMode) {
- Console.WriteLine("consolemode started");
- // ...
- } else {
- Application.EnableVisualStyles();
- Application.SetCompatibleTextRenderingDefault(false);
- Application.Run(new Form1());
- }
- }
- }
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- namespace ConsoleApplication9 {
- class Program {
- [STAThread]
- static void Main(string[] args) {
- if (args.Length > 0 && args[0] == "console") {
- Console.WriteLine("Hello world!");
- Console.ReadLine();
- }
- else {
- Application.EnableVisualStyles();
- Application.SetCompatibleTextRenderingDefault(false);
- Application.Run(new Form1());
- }
- }
- }
- }
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- namespace ConsoleApplication9 {
- public partial class Form1 : Form {
- public Form1() {
- InitializeComponent();
- }
- private void Form1_Click(object sender, EventArgs e) {
- Console.WriteLine("Clicked");
- }
- }
- }
Add Comment
Please, Sign In to add comment