473,788 Members | 2,820 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

run winform to console

I have written a winform application not I need to run the same app in
colsole mode without user interaction. Is there an easy way to do
this? I have all the information available as input in the seperate
file so....
Jun 27 '08 #1
2 2071
On Apr 23, 11:22 am, CSharper <cshar...@gmx.c omwrote:
I have written a winform application not I need to run the same app in
colsole mode without user interaction. Is there an easy way to do
this? I have all the information available as input in the seperate
file so....
I may be completely wrong but it seems straightforward to me. I think
you should pass the file as argument to the Main method and write code
to parse the inputs from the file and set them to the respective UI
elements ( rather to the actual fields that the UI elements represent)
and trigger the logic. If you do not want the UI to appear, you can
simply add a branch in the main method for the count of input
arguments == 1. If its 0 show the UI. if not hide it.
Jun 27 '08 #2
On Apr 23, 10:51 am, mgsram <mgs...@gmail.c omwrote:
On Apr 23, 11:22 am, CSharper <cshar...@gmx.c omwrote:
I have written a winform application not I need to run the same app in
colsole mode without user interaction. Is there an easy way to do
this? I have all the information available as input in the seperate
file so....

I may be completely wrong but it seems straightforward to me. I think
you should pass the file as argument to the Main method and write code
to parse the inputs from the file and set them to the respective UI
elements ( rather to the actual fields that the UI elements represent)
and trigger the logic. If you do not want the UI to appear, you can
simply add a branch in the main method for the count of input
arguments == 1. If its 0 show the UI. if not hide it.
Yes, I went back and looked at it, Winform is paunched from program.cs
there I put the logic to check and see if there is any parameters
passed, if it is passed then run as GUI else console. That will sove
my problem.
Thanks.
Jun 27 '08 #3

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

Similar topics

0
1324
by: Bnaya | last post by:
I'm invoking the same Dll from Console application and WinForm application Both signed with SrongName. the class that I'm invoking is protected with StrongNameIdentityPermission Demand
5
2317
by: Sunny | last post by:
Hi, If I have (hmm, at least I want to have :) ) a winform, displaying the progress of a long duration method, which is running in a separate thread, how do I implement canceling the thread, if I click a button on the form. Any directions, examples, etc. Thanks Sunny
3
3708
by: Liren Zhao | last post by:
I use some "Console.WriteLine(some strings here)" to display some debug information in my winform program. How can I get the information in my programe or same them in a text file ?
1
2154
by: Ollie Riches | last post by:
Does anyone know a way to create a winform window that has similiar functionality to the 'Output' window in VS .Net - i.e. that basically acts like a console window but is proper MDI child of the main winform application and does not look like a DOS window :). I have tried using an RTF but that was not particularly great when a lot of information is displayed quickly. I don't want to know how to show a console window using the...
2
4750
by: Steve | last post by:
I have created a console app that simply prints out a message a couple times, then exits, here is the code: <code> for(int i = 0; i < 10; i++) { System.Threading.Thread.Sleep(500); Console.WriteLine(String.Format("Sleeping...{0}", i)); } Console.WriteLine("Done!"); </code>
6
2811
by: WT | last post by:
Hello, Using VS2005. I have an assembly library that can be called from a Web site asp.net application or from a winform application. From this library I need to retrieve a path using simply a key like 'libPath'. As far as winform and asp.net share the same common base class for settings, SettingsBase, how to manage this ? For winform the value should be set in app.config and for web site in
0
902
by: Tom | last post by:
Hi all -- this is my first posting here and I want to start by saying thank you to all the responders. I have done some searching and reading and have learned a few things I didn't even know to enough about to ask! This group rocks!! :) I am hoping to find a guru who knows how to relate to a beginner. I am using VS2005 Academic version and am just now learning WinForms. They are awesome. I have almost zero MFC experience and I am hoping...
1
2451
by: ffimbel | last post by:
Hi I would like to implement a single exe which could be invoked either as a standard windows form (no argument) or as a console app (when run with app.exe -nologo). I tried compiling the exe as a winform app and use win32 app to create a console but when launched from a dos command line, it does not use the launching console but create a new one
6
4579
by: None | last post by:
Hello, my app is written in C#. Given an app file path (e.g. e:\abc.exe), how can I determine if it's a winform app or a console one. (note: abc.exe can be either a native exe or a .net one)
0
10366
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10173
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
10110
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,...
0
9967
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...
1
7517
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
6750
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
5399
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
5536
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2894
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.