473,839 Members | 1,408 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

System.Console in WindowsApplicat ion

If in a WindowsApplicat ion in the static main method I have something like:

System.Console. WriteLine("Star ting Application ..:");

and I start this WindowsApplicat ion from a console I won't recive the
"Starting Application ..:" message. Why?
Nov 15 '05 #1
3 1592
hi stefano,

do you have Console.Read() or Console.ReadLin e() after your
Console.WriteLi ne()?
if not, you should put one because WriteLine() alone will automatically exit
the application.

--
gani
pls. visit http://thedeveloperscorner.com.ph

"Stefano Meier" <st*********@fr eesurf.ch> wrote in message
news:10******** *******@fuchs.c yberlink.ch...
If in a WindowsApplicat ion in the static main method I have something like:
System.Console. WriteLine("Star ting Application ..:");

and I start this WindowsApplicat ion from a console I won't recive the
"Starting Application ..:" message. Why?

Nov 15 '05 #2
Stefano Meier <st*********@fr eesurf.ch> wrote:
If in a WindowsApplicat ion in the static main method I have something like:

System.Console. WriteLine("Star ting Application ..:");

and I start this WindowsApplicat ion from a console I won't recive the
"Starting Application ..:" message. Why?


Because a Windows Application detaches itself from the console that
starts it (if any) as soon as it starts.

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 15 '05 #3
Hi Stefano,

I suppose the reason is that a Windows GUI application does not have a
console allocated to it. With Windows API, one could either allocate a new
console or use the parent application's console (not sure about that). With
..NET, it seems to be no easy way to allocate a console, but I may be wrong.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Stefano Meier" <st*********@fr eesurf.ch> wrote in message
news:10******** *******@fuchs.c yberlink.ch...
If in a WindowsApplicat ion in the static main method I have something like:
System.Console. WriteLine("Star ting Application ..:");

and I start this WindowsApplicat ion from a console I won't recive the
"Starting Application ..:" message. Why?


Nov 15 '05 #4

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

Similar topics

4
3856
by: William McIlroy | last post by:
Array Bounds Exception inside system.xml.dll. Test data is a dozen GB (available for the asking on CD). Source code follows. Call into system.xml.dll happens at the while statement.. using System using System.Xml using System.Collections // This program reads an ASCII file of XML elements // The output is a list of unique NODE TYPEs // For example, <head> produces head in the output // There is no validation of the XML
0
419
by: MJ | last post by:
I have an application that I am test deploying to others in my company. The application runs fine in the IDE as well as from the exe on my PC. However, when I install the program on another PC I get the following error when I try to run it: An unhandled exception of type 'System.TypeInitializationException' occurred in Unknown Module. Additional information: The type initializer for "WindowsApplication.MainModule" threw an exception ...
6
10223
by: Don | last post by:
I'm having problems working with a streamwriter object. After closing the streamwriter and setting it to Nothing, I try to delete the file it was writing to, but I always get the following error message: "The process cannot access the file "whatever" because it is being used by another process." I've even tried opening another file using the same streamwriter object before deleting the original file, but it's no use. Something keeps...
20
1487
by: djc | last post by:
I get this *intermittently* on a utility I am working on. I don't know whats going on but here are a few points about it: - using VS 2005, running on xp sp2 - program uses multiple threadpool threads - only happens when built with the 'release' configuration (no debug flag, compiler optimizations in effect) - no problems in debug config here is the error: Unhandled Exception: System.AccessViolationException: Attempted to read or write...
2
1290
by: bg_ie | last post by:
Hi, I wish to write a WindowsApplication which prompts the user to enter a set of values in text boxes. I then what to write these values to an xml file. I have created my own class where these values can be stored as the application runs, but I am unsure where to declare an object belonging to this class. Should it be in the program class as a static member and do I then pass it to my Forms constructor? Thanks for your help,
2
1589
by: overworkedJenny | last post by:
when i try to open a new project i get this long message with basically says WindowsApplication.vbproj is not installed. IS there any way to re-install it without installing/reinstalling the whole program...? plus when i try to uninstall vb.net my printer copy program come up????? help...anyone... OverWorkedJenny
0
883
by: overworkedJenny | last post by:
every time i try and open a new anything a message pops up basically stating my WindowsApplication.vbproj is not installed....i dont know what the file is... can i download this from a website....i dont have the program discs to reinstalle the whole program, and my computer wont let me uninstall the program either... HELP someone. thanks.
1
4100
by: dotnetnari | last post by:
hi, How to Drag and drop the nodes from treeview into datatable columns using windowsapplication in c# Thanks
1
4606
by: nygiantswin2005 | last post by:
Hi I am trying to resolve this bug that I have in this application. The code is below. It will generate this Exception System.UnauthorizedAccessException: Access to the path is denied. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.__Error.WinIOError() at System.IO.FileInfo.MoveTo(String destFileName)
0
9855
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9697
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
10586
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...
0
10293
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9426
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7828
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
7017
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();...
1
4484
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
3134
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.