H
- HAL9000
When I run the code below, nothing appears in the notepad window. I
am expecting the WriteLine text to be written into notepad but I get
nothing.
Also, I would expect the notepad window to be "Minimized" but it
isn't. Both WindowStyle and CreateNoWindow seem to have no effect.
I've already looked at:
http://msdn.microsoft.com/library/e...sStartInfoClassRedirectStandardInputTopic.asp
Thanks for you insight,
Forrest
Imports System.Diagnostics
Imports System.IO
Namespace AgentNameSpace
Class AgentClass
Shared Sub Main()
Dim agentProcess As New Process()
agentProcess.StartInfo.FileName = "notepad.exe"
agentProcess.StartInfo.UseShellExecute = False
agentProcess.StartInfo.CreateNoWindow = True
agentProcess.StartInfo.RedirectStandardInput = True
agentProcess.StartInfo.WindowStyle =
ProcessWindowStyle.Minimized
agentProcess.Start()
Dim agentStdInput As StreamWriter =
agentProcess.StandardInput
agentStdInput.WriteLine("some text")
agentStdInput.Flush()
agentStdInput.WriteLine("some more text...")
agentStdInput.Close()
End Sub
End Class
End Namespace
am expecting the WriteLine text to be written into notepad but I get
nothing.
Also, I would expect the notepad window to be "Minimized" but it
isn't. Both WindowStyle and CreateNoWindow seem to have no effect.
I've already looked at:
http://msdn.microsoft.com/library/e...sStartInfoClassRedirectStandardInputTopic.asp
Thanks for you insight,
Forrest
Imports System.Diagnostics
Imports System.IO
Namespace AgentNameSpace
Class AgentClass
Shared Sub Main()
Dim agentProcess As New Process()
agentProcess.StartInfo.FileName = "notepad.exe"
agentProcess.StartInfo.UseShellExecute = False
agentProcess.StartInfo.CreateNoWindow = True
agentProcess.StartInfo.RedirectStandardInput = True
agentProcess.StartInfo.WindowStyle =
ProcessWindowStyle.Minimized
agentProcess.Start()
Dim agentStdInput As StreamWriter =
agentProcess.StandardInput
agentStdInput.WriteLine("some text")
agentStdInput.Flush()
agentStdInput.WriteLine("some more text...")
agentStdInput.Close()
End Sub
End Class
End Namespace