TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
johnmanny2
NA
1
0
Writing to a process
Sep 18 2003 12:00 PM
Hi all, I appreciate some help on this code. I'm trying to execute an external application, which takes some parameters. I was able to execute it but not able to pass any parms to it. I’m using StreamWriter to do this but getting an error "StandardIn has not been redirected.". IS this the only way to do it. I have tried various things but ran out of options. Any help is appreciated. my code: ------ using System; using System.Diagnostics; using System.IO; using System.Threading; namespace ConsoleApplication5 { ///
/// Summary description for Class1. ///
class Class1 { ///
/// The main entry point for the application. ///
[STAThread] static void Main(string[] args) { Process p = new Process(); StreamWriter sw; ProcessStartInfo psI = new ProcessStartInfo"ping"); psI.RedirectStandardInput = true; psI.UseShellExecute = false; psI.CreateNoWindow = true; p.StartInfo = psI; sw = p.StandardInput; sw.AutoFlush = true; sw.WriteLine(); p.Start(); Thread.Sleep(9000); } } } Thanks John
Reply
Answers (
2
)
Security Exeception
PInvoke & DllImport