Am wondering is there anything called Console-less application with same features of console.
Detail: I like to write an application, where I can call the application 开发者_JAVA技巧(myapp.exe arg1 arg2), but don't want any console to show up. All it does is generating an .ASX file. Am currently calling this application from Windows Media Center, so I don't want console to show up.
Any thoughts and suggestions? Thanks.
In your project properties, change the output type to 'Windows Application' and select your Program
class as your startup object (or whichever class contains your Main
method).
To do it from scratch, just create a Windows Application, delete the form the template creates by default, and modify your Main
method to run your code.
You could try something like this.
Another thing to consider is that even form applications can accept parameters. You could either just not open up a form, or hide it to begin with.
In Visual Studio 2005 (.NET 2.0) and above, you can just create a Windows Forms application and then pull the form display out of the Program.Main method and put your logic there:
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
//Application.EnableVisualStyles();
//Application.SetCompatibleTextRenderingDefault(false);
//Application.Run(new Form1());
// TODO: Your logic here
}
}
精彩评论