Developer technologies | VB
An object-oriented programming language developed by Microsoft that can be used in .NET.
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi ,I want to control the input and output of "I2C Tools" from a visual basic program. I use the following code and receive the errors:
BC30205 and BC30002
Module Module1
Sub Main()
Dim myProcess As Process = New Process()
Dim s As String myProcess.StartInfo.FileName = "cmd.exe"
myProcess.StartInfo.UseShellExecute = False
myProcess.StartInfo.CreateNoWindow = True
myProcess.StartInfo.RedirectStandardInput = True
myProcess.StartInfo.RedirectStandardOutput = True
myProcess.StartInfo.RedirectStandardError = True
myProcess.Start()
Dim sIn As StreamWriter = myProcess.StandardInput
Dim sOut As StreamReader = myProcess.StandardOutput
Dim sErr As StreamReader = myProcess.StandardError
sIn.AutoFlush = True
sIn.Write("dir c:\windows\system32\*.com" & System.Environment.NewLine)
sIn.Write("exit" & System.Environment.NewLine)
s = sOut.ReadToEnd()
If Not myProcess.HasExited Then
myProcess.Kill()
End If
End Sub
End Module
How can I resolve this errors?
Please help
Thanks
An object-oriented programming language developed by Microsoft that can be used in .NET.
You have put 2 instructions on the same line :
Dim s As String myProcess.StartInfo.FileName = "cmd.exe"
=>
Dim s As String
myProcess.StartInfo.FileName = "cmd.exe"