|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How to put shell output into a textboxdata into a file I'd like it to go into a TextBox. Can someone show me how to do that thanks pi.RedirectStandardOutput = True pi.FileName = .FileName pi.UseShellExecute = False Dim sw As New System.IO.StreamWriter("C:\OutPut.txt") p = Process.Start(pi) sw.WriteLine(p.StandardOutput.ReadToEnd) p.WaitForExit() sw.Close() " Franky" <frankieNOSPAM@a-znet.com> schrieb: Line of code removed here.> Got this from the Internet. Almost what I need except instead of putting > the data into a file I'd like it to go into a TextBox. >[...] > pi.RedirectStandardOutput = True > > pi.FileName = .FileName > > pi.UseShellExecute = False > p = Process.Start(pi) Line of code altered here:\\\ Me.TextBox1.Text = p.StandardOutput.ReadToEnd() /// Show quoteHide quote > p.WaitForExit() > > sw.Close() -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://dotnet.mvps.org/dotnet/faqs/> so easy when you know how
thanks Show quoteHide quote "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message news:%23BC39BYIHHA.5000@TK2MSFTNGP03.phx.gbl... >" Franky" <frankieNOSPAM@a-znet.com> schrieb: >> Got this from the Internet. Almost what I need except instead of putting >> the data into a file I'd like it to go into a TextBox. >>[...] >> pi.RedirectStandardOutput = True >> >> pi.FileName = .FileName >> >> pi.UseShellExecute = False > > Line of code removed here. > >> p = Process.Start(pi) > > Line of code altered here: > > \\\ > Me.TextBox1.Text = p.StandardOutput.ReadToEnd() > /// > >> p.WaitForExit() >> >> sw.Close() > > -- > M S Herfried K. Wagner > M V P <URL:http://dotnet.mvps.org/> > V B <URL:http://dotnet.mvps.org/dotnet/faqs/> I noticed you used "Me" below. I like that and wish there is a switch that
tells the compiler that it is never to be assumed - that is, catch me when I don't use it. Is there such an option? Thanks Show quoteHide quote "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message news:%23BC39BYIHHA.5000@TK2MSFTNGP03.phx.gbl... >" Franky" <frankieNOSPAM@a-znet.com> schrieb: >> Got this from the Internet. Almost what I need except instead of putting >> the data into a file I'd like it to go into a TextBox. >>[...] >> pi.RedirectStandardOutput = True >> >> pi.FileName = .FileName >> >> pi.UseShellExecute = False > > Line of code removed here. > >> p = Process.Start(pi) > > Line of code altered here: > > \\\ > Me.TextBox1.Text = p.StandardOutput.ReadToEnd() > /// > >> p.WaitForExit() >> >> sw.Close() > > -- > M S Herfried K. Wagner > M V P <URL:http://dotnet.mvps.org/> > V B <URL:http://dotnet.mvps.org/dotnet/faqs/> " Franky" <frankieNOSPAM@a-znet.com> schrieb: No. I use 'Me.' only to get an appropriate IntelliSense selection list when >I noticed you used "Me" below. I like that and wish there is a switch that >tells the compiler that it is never to be assumed - that is, catch me when >I don't use it. > > Is there such an option? writing code. -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://dotnet.mvps.org/dotnet/faqs/> Thanks
One more question. The following does not work Can you tell me what does pi.FileName = "%SystemRoot%\shell32\cmd.exe" Show quoteHide quote "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message news:eoPmU9fIHHA.4112@TK2MSFTNGP04.phx.gbl... >" Franky" <frankieNOSPAM@a-znet.com> schrieb: >>I noticed you used "Me" below. I like that and wish there is a switch that >>tells the compiler that it is never to be assumed - that is, catch me when >>I don't use it. >> >> Is there such an option? > > No. I use 'Me.' only to get an appropriate IntelliSense selection list > when writing code. > > -- > M S Herfried K. Wagner > M V P <URL:http://dotnet.mvps.org/> > V B <URL:http://dotnet.mvps.org/dotnet/faqs/> " Franky" <frankieNOSPAM@a-znet.com> schrieb: On my machine no such path exists. In addition you may want to check the > The following does not work > > Can you tell me what does > > pi.FileName = "%SystemRoot%\shell32\cmd.exe" environment variable-related methods of the 'System.Environment' class which can be used to expand environment variables inside strings representing a path. However, 'pi.FileName = "cmd.exe"' should be sufficient. -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
I want to KEEP trailing zeros
Sending an XML Node to a Function for Processing Setting focus to the Form Screen Scraping a Password Protected Site SP1 Install - was it successful? SQL Server Authentication issues! Problem with datagridview Implement Icomparable Windows Service, Process.Start Need some For Loop Next Item |
|||||||||||||||||||||||