.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

How to "fork" console when my winForm is in a pipe?

Posted By:      Posted Date: September 29, 2010    Points: 0   Category :.NET Framework

Hi All,

I have a winform app, which can read from stdin. That is fine basically, but it hangs the belonging console when I start it in a pipeline. In other words, if I start it like "dir|mynotepad", I can reach the data in my app, but the console where I started the app is waiting till I close my form.

I'd like to get my prompt back, once I read all the data from stdin. I have tried to create new thread/process, but they cannot survive the main thread. I tryed it in c#, .net3.5 on winXP.

Could anyone give me some advise please?

Any help would be really appreciated. Thanks,

View Complete Post

More Related Resource Links

.NET Matters: Handling Messages in Console Apps


Many developers who use the Microsoft .NET Framework think that application type is tied to the libraries that can be used in that application. Stephen Toub clarifies.

Stephen Toub

MSDN Magazine June 2007

Standard I/O: Console Appplications in .NET, or Teaching a New Dog Old Tricks


The Microsoft .NET Framework is not just about Windows Forms and Web services. This article discusses the simplest kind of Framework-based application-the console app-along with the frequently overlooked constructs of standard input/output and the pipe. When designed carefully, console applications offer a surprisingly powerful way of solving complex programming problems. One of the more exciting aspects of this approach is that while each application in the pipe is fairly simple, the result of their interaction can be a relatively complex task. Here the author explores the ins and outs of writing these console apps.

Michael Brook

MSDN Magazine February 2004

Whistler: Build More Flexible Console Snap-ins with the MMC 2.0 Object Model


Microsoft Management Console (MMC) 2.0 provides a host of exciting new features for MMC users and snap-in developers. The new MMC 2.0 automation object model allows much of the user interface of MMC 2.0 to be accessed through script, and exposes events so that many tasks can now easily be automated. The new view extension model uses HTML to enable extensions to seamlessly integrate new user interfaces with those of existing snap-ins. MMC 2.0 also includes a specific view extension snap-in, the Extended View snap-in, which provides an interface similar to Web folders. Drag and drop support has been expanded, and console files now use the XML file format. Enhancements to console taskpads make it easier to accomplish tasks.

Vivek Jhaveri

MSDN Magazine March 2001

Looking for a simple Service and Console Client REST sample implementing BASIC authentication


Does anyone know of a C# code sample demonstrating WCF REST services and console test client with OperationContracts (GET and POST) implementing mutiple paramaters using BASIC authentication? Also, perhaps, using Fiddler as a test client as well? I have searched high and low for something like this, but have not had any success.

Want to Create Table Dynamically With text Control in WinForm Csharp

Hello To All... from Many Days i m tryng to create a simple table using csharp in WinForm.Which will include textbox in each cell according the Passed No of Col & Row. but not getting the proper result. Actually i want to trace each cell data and want to save each cell data to data base : eg. in cell 11(1col & 1row) i m having Combobox which having some item list and when the user select the list item the data will save to the database. Regards, Praveen    What is the Key of Life ... Its Sharing Your Thought & Knowledge ...

Remotely access winform application through admin panel

I am going to develop following application but not sure how to do this   Application will run different instances for various clients on different servers.     Each instance will run on different criteria stored in database managed by an admin.     Would like to be able to run this from the admin section.     Maybe using a server command line component and pipin the output into a web based admin? -- Whatever you think is best.     This application will run basically 24-7   Any best solution, idea etc

WriteLine - Writing to the VS Output window or to the Console

I know the WriteLine activity has a TextWriter argument that can be set to direct where the output is received but how can I have it output into the Output window of Visual Studio? For few tests, it would be helpful when running the test, I could see some output within VS.Blades Don't Need Reloading...

Login to SPSite\SPWeb through console app using user/password

Hi,I'm developing some basic console application which interacts with SharePoint site through the object mode. I'm using:SPSite site = new SPSite(MySiteUrl); SPWeb web = site.OpenWeb(); This way, current windows user is acessing the site. Is it possible to supply the user with username/password to be able to acess with different credentials than current?Thanks in advance!

how run my C# console application when i start the computer ?

hi i have build a console application (any listener) and i need that when i open the computer - this application will run. i don't have installation for hem (it a simple little .exe file) is there any way to do it through my C# code ? thank's in advance

Auto saving the Winform application

hi,   I am developing a huge win form application, which has lot of win forms, user controls and wizards. For user it will take some time to fill-in all the fields and complete the wizard. I wanted to implement auto saving the application for every 3-4 minutes, this should be done in the background without disturbing the user activity (or thread)..   can anyone help me to implement this? Please share your ideas.   thanks

C# winform.controls for novice

i wanna separate my content as wpf's expander in win-form. tree's node as detail-view separate the tab with a little px in tab-control; round the coner

Restart a Wpf Application from a WinForm

I have a problem with a solution that I'm trying to develope. This is my scenario: I have a VB6 application and I would call from this application some WPF windows. I've used the Interop Form Library to define a WinForm like a bridge from VB6 to WPF. The Interop WinForm exposes the methods to start and shutdown the wpf application. To do that, in the WPF Application I've defined an helper like this: Public Class StartApplicationHelper Public Shared Property IsReady As Boolean = False Public Shared Event NotifyEvent As ValueEnterEventHandler Public Shared Sub Start() If System.Windows.Application.Current Is Nothing Then Try Dim myApp As Application = New Application myApp.ShutdownMode = ShutdownMode.OnExplicitShutdown myApp.InitializeComponent() IsReady= True Catch ex As Exception MessageBox.Show(ex.Message) End Try End If End Sub Public Shared Sub Shutdown() If System.Windows.Application.Current IsNot Nothing Then System.Windows.Application.Current.Shutdown() IsReady = False End If End Sub Public Shared Sub DispatchEvent(ByVal eve As String) If IsReady Then EventDispatcherService.DispatchEvent(eve, New EventDispatcherDataChildWin(String.Empty, Nothing, Nothing, False)) End Sub Public Shared Sub DispatchResult(ByVal

net.pipe binding and Pipe is being closed error.

Hi, I am using net named pipe binding for the communication. I have came across many blogs regarding the 'pipe is being closed' error. When pipe is inactive then it is getting closed. I have set is and every time out to max. But still I get this error. Even I set the IdleTimeout as below. Then also my connection get closed. namedPipeBinding.CreateBindingElements().Find<NamedPipeTransportBindingElement>().ConnectionPoolSettings.IdleTimeout = new TimeSpan(23,0,0,0); And at server side I have (as I see in many blogs suggestion to avoid the closing of pipe) namedPipeBinding.ReceiveTimeout = timeOut; Is there any specific reason for this? ThanksRegards, Nakul

Getting net.pipe protocol scheme working n IIS 7

Hello!We have several web services that all work together.  These have been tested in our DEV envrionment and are working quite well.  One of these is a caching manager that runs on each server and the client services talk to it via named Pipes which is quite fast!  Today, we started moving our services from DEV to our PROD environment running on Server2008 R2.  Our dev envrionment is Windows 7.  Where as our DEV envrionment is a single machine sandbox, our PROD environment is multiple servers and multiple web sites.  We have a single site set up on each server to run this namedPipe enabled service.  We set everything up (at least from IIS) to be identical to the Win7 IIS environment, but we just cannot get the SVC page to show us the service definition.When I get into the console of IIS , right click on the SVC file and select BROWSE, I get an error as folows:Could not find a base address that matches scheme net.pipe for the endpoint with binding NetNamedPipeBinding. Registered base address schemes are [http]. We did install the activiation component of .net on our IIS server.We are running .Net 3.5.1 on our IIS server (running IIS 7.0 on Server 2008 R2)However, when I go to the advanced settings for my site, and look at Enabled Protocols I see:http,net.pipe,net.tcp And when I go to my application under the site and look at advanced settings I see:http,net.pipe,net.tcp This is

Query regarding Console.Writeline()

I was wondering how the Writeline function works and so i went to its definition in the Console Class.But to my amazement i found out that none of the Writeline () methods had a definition (as in the body of the method).So how does the Writeline function really work? Can anyone please help me out with my query.

Login error - No process is on the other end of the pipe on initial logon attempt

I am having a logon problem with asp.net apps that were created using Visual Web Developer 2008.  Data is on SQL Server Express 2008 running on Windows 2003 server with IIS6.  Connection is on a LAN.  The first time I try to log in to the site, I get the following error:Server Error in '/' Application.A connection was successfully established with the server, but then an error occurred during the login process. (provider: Named Pipes Provider, error: 0 - No process is on the other end of the pipe.)Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.Data.SqlClient.SqlException: A connection was successfully established with the server, but then an error occurred during the login process. (provider: Named Pipes Provider, error: 0 - No process is on the other end of the pipe.)Source Error:An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.Stack Trace:[SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred during the login process. (provider: Named Pipes Provider, error: 0 - No proce
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend