Hey everyone
I'm sort of a newbie with C# and I have downloaded a server-sided game source that uses GUI's. Personally I don't think GUI's are suitable at all for a game server so I wanted to change that to a Console instead.
So here is my problem. To run the server, you make a shortcut that opens the GUI with a configuration file. I tried changing this following code.
I removed everything here and changed it to this, to test and see if it would work.Code:using System; using System.Collections.Generic; using System.Linq; using System.Windows.Forms; namespace ConsoleApplication1 { static class Program { public static frmMain MainForm { get; set; } public static string IMGFilename { get; set; } /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main(string[] args) { if (args.Length != 1) { MessageBox.Show("Invalid argument length."); } else { IMGFilename = args[0]; try { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(MainForm = new frmMain()); //Timer.Stop(); } catch (Exception ex) { MessageBox.Show(ex.ToString()); MainForm.Close(); Application.Exit(); } } } } }
When I double click on the compiled executable, nothing will open or anything.Code:using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { Console.WriteLine("Derp"); Console.Read(); } } }
if anyone would like to provide assistance over either PM's or MSN it would be greatly appreciated!
Thanks everyone!




Reply With Quote