473,785 Members | 2,249 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Invisiable console application

I am trying to build a console application in C#.Net. This application
is suppose to run in background without user interaction. How can I
hide console to appear?

Nov 17 '05 #1
3 15030
Then you must make sure that you will run it as an service.

inpreet wrote:
I am trying to build a console application in C#.Net. This application
is suppose to run in background without user interaction. How can I
hide console to appear?

Nov 17 '05 #2
In case you're curious, see my response.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
There's a seeker born every minute.
- Dr. "Happy" Harry Cox

"Don Pinkster" <do**********@g mail.com> wrote in message
news:dl******** **@news3.zwoll1 .ov.home.nl...
Then you must make sure that you will run it as an service.

inpreet wrote:
I am trying to build a console application in C#.Net. This application
is suppose to run in background without user interaction. How can I
hide console to appear?

Nov 17 '05 #3
A Console application is an application that presents a console to the user.
The console is the user interface. Therefore, you can't, by definition,
write a console application that doesn't present a cosole to the user. What
you *can* do is write a class library that has a class to perform whatever
task you want to perform. Then you can create a Windows Application that
does not create an instance of a form, but in the Main() function, simply
creates an instance of the class in the class library and calls it to
perform the task.

If you need to be able to use the class in a Console as well, create a
Console application that does the same thing (employs the class library). A
nice trick is to create both the Windows application and the Console
application, and add parameters to the command for the Windows application
that enable it to run in "windowless " mode. What this would do is to either
spawn the Console application as a process, or run without spawning the
Console application, and simply perform the work itself.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
There's a seeker born every minute.
- Dr. "Happy" Harry Cox

"inpreet" <in*****@gmail. com> wrote in message
news:11******** **************@ g43g2000cwa.goo glegroups.com.. .
I am trying to build a console application in C#.Net. This application
is suppose to run in background without user interaction. How can I
hide console to appear?

Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
2328
by: Job Lot | last post by:
How can I terminate console application in Try…Catch…Finally…End Try block so that code in Finally gets executed. If I use End statement Finally does not get executed. Following is my code written in Console Application. Module Module1 Sub Main() Call Testing()
1
5387
by: Oz | last post by:
This is long. Bear with me, as I will really go through all the convoluted stuff that shows there is a problem with streams (at least when used to redirect stdout). The basic idea is that my application (VB.NET) will start a process, redirect its stdout and capture that process' output, displaying it in a window. I've written a component for this, and a test application for the component. It allows me to specify a command to execute,...
2
1155
by: nss | last post by:
hi, I created web page ( .aspx) then i imported datagrid on that page with dataset. But when i launch the page on web server the datagrid is invisiable. Can someone help me how i can make it visible when launch on web server. regards, Sam
6
3236
by: Mark Allison | last post by:
Hi, I have an application that I want to be to run in Console mode and GUI mode. If no params are entered, I want the GUI fired up, if params are entered, then go into console mode. I believe I have all the code set up to do this, however when I issue a Console.WriteLine instruction, nothing gets written to the console. In fact, the command prompt comes back before the program has finished executing. What do I need to do?
5
11258
by: Barry Mossman | last post by:
Hi, can I detect whether my class is running within the context of a Console application, vs say a WinForm's application ? also does anyone know whether the compiler or runtime is smart enough to avoid the overhead of writing to the console if it is not visible, eg I am running inside a WinForm application. thanks
17
4235
by: MumboJumbo | last post by:
Hi I have a really basic question hopefully some can help me with: Can you write a (i.e. one) C# project that works from the cmd line and gui? I seems if i write a GUI app it can't write to console using System.Console.WriteLine if thge project has its "Output Type" to "Windows Application". However I can write to stdio if i set output type to "Console Application". When I do this I unfortunately get a "console box" as well
6
5714
by: tony | last post by:
Hello! When you have windows forms you have the same possibility as when you have a Console application to use Console.Writeln to write whatever on the screen. Now to my question: Is it possible to use Console.Writeln when you have a Webservice. I don't think it's possible but just to be sure I ask you?
10
6350
by: Stephany Young | last post by:
When one uses the System.Diagnostics.Process.Start method to launch a common or garden Console application, one can set the WindowStyle property of the StartInfo object to ProcessWindowStyle.Hidden so that the window for the Console application is not visible. However, when using some of the 'advanced' properties of the StartInfo object, like Username, Password and Domain, the WindowsStyle property of the StartInfo object is ignored....
12
6543
by: Dilip | last post by:
Hi All I have a server based C# console application. This application must hide its console window when its launched out on the field. So I dutifully P/Invoke'd FindWindow/ShowWindow combination to hide the console window at launch time. The application (for legacy reasons) hangs around by waiting on an old- fashioned Console.ReadLine() statement.
0
9485
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10161
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10098
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7506
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6743
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5390
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5523
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4058
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2890
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.