Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space PRINSAG and version 9.0
Sv translation
languageen

You can run an external program to check a process from within your rule by editing the code.
The System.Diagnostics.Process class allows you to do this.

 

' Create a process to run the DOS command in
Dim oProcess As New System.Diagnostics.Process

' Fill in the DOS command details
oProcess.StartInfo.FileName = sExeName
oProcess.StartInfo.Arguments = sArguments
oProcess.StartInfo.UseShellExecute = False
oProcess.StartInfo.CreateNoWindow = True
oProcess.StartInfo.RedirectStandardOutput = True

' Run the DOS command
oProcess.Start()

' Set a timer and, if the process doesn't complete in time, kill it
Dim bSuccess As Boolean = oProcess.WaitForExit(1000 * iTimeoutSeconds)

' If the process completed in time
If bSuccess Then
' Create a StreamReader to read the output from the DOS command
Dim oOutputStream As System.IO.StreamReader = oProcess.StandardOutput

' Create a simple string to hold the output from the DOS command
Dim sOutput As String = oOutputStream.ReadToEnd()

' Create an integer to hold the exit code from the DOS command
Dim iExit As Integer = oProcess.ExitCode

< … Do something with the results … >

End If

Sv translation
languagede

Sie können ein externes Programm ausführen, um einen Prozess aus einer Regel zu überprüfen, indem Sie den Code bearbeiten.
Dieser Vorgang wird durch die System.Diagnostics.Process-Klasse ermöglicht.
' Create a process to run the DOS command in
Dim oProcess As New System.Diagnostics.Process
' Fill in the DOS command details
oProcess.StartInfo.FileName = sExeName
oProcess.StartInfo.Arguments = sArguments
oProcess.StartInfo.UseShellExecute = False
oProcess.StartInfo.CreateNoWindow = True
oProcess.StartInfo.RedirectStandardOutput = True
' Run the DOS command
oProcess.Start()
' Set a timer and, if the process doesn't complete in time, kill it
Dim bSuccess As Boolean = oProcess.WaitForExit(1000 * iTimeoutSeconds)
' If the process completed in time
If bSuccess Then
' Create a StreamReader to read the output from the DOS command
Dim oOutputStream As System.IO.StreamReader = oProcess.StandardOutput
' Create a simple string to hold the output from the DOS command
Dim sOutput As String = oOutputStream.ReadToEnd()
' Create an integer to hold the exit code from the DOS command
Dim iExit As Integer = oProcess.ExitCode
< … Do something with the results … >
End If

Sv translation
languagezh

可以通过编辑代码,运行外部程序来检查规则内的处理。
使用 System.Diagnostics.Process 类可执行此操作。
' Create a process to run the DOS command in
Dim oProcess As New System.Diagnostics.Process
' Fill in the DOS command details
oProcess.StartInfo.FileName = sExeName
oProcess.StartInfo.Arguments = sArguments
oProcess.StartInfo.UseShellExecute = False
oProcess.StartInfo.CreateNoWindow = True
oProcess.StartInfo.RedirectStandardOutput = True
' Run the DOS command
oProcess.Start()
' Set a timer and, if the process doesn't complete in time, kill it
Dim bSuccess As Boolean = oProcess.WaitForExit(1000 * iTimeoutSeconds)
' If the process completed in time
If bSuccess Then
' Create a StreamReader to read the output from the DOS command
Dim oOutputStream As System.IO.StreamReader = oProcess.StandardOutput
' Create a simple string to hold the output from the DOS command
Dim sOutput As String = oOutputStream.ReadToEnd()
' Create an integer to hold the exit code from the DOS command
Dim iExit As Integer = oProcess.ExitCode
< … Do something with the results … >
End If

Sv translation
languagees

Es posible ejecutar un programa externo para comprobar un proceso desde dentro de la regla editando el código.
La clase System.Diagnostics.Process permite hacer esto.
' Create a process to run the DOS command in
Dim oProcess As New System.Diagnostics.Process
' Fill in the DOS command details
oProcess.StartInfo.FileName = sExeName
oProcess.StartInfo.Arguments = sArguments
oProcess.StartInfo.UseShellExecute = False
oProcess.StartInfo.CreateNoWindow = True
oProcess.StartInfo.RedirectStandardOutput = True
' Run the DOS command
oProcess.Start()
' Set a timer and, if the process doesn't complete in time, kill it
Dim bSuccess As Boolean = oProcess.WaitForExit(1000 * iTimeoutSeconds)
' If the process completed in time
If bSuccess Then
' Create a StreamReader to read the output from the DOS command
Dim oOutputStream As System.IO.StreamReader = oProcess.StandardOutput
' Create a simple string to hold the output from the DOS command
Dim sOutput As String = oOutputStream.ReadToEnd()
' Create an integer to hold the exit code from the DOS command
Dim iExit As Integer = oProcess.ExitCode
< … Do something with the results … >
End If

Sv translation
languagefr

Vous pouvez exécuter un programme externe pour vérifier un processus depuis votre règle en modifiant le code.
La classe System.Diagnostics.Process permet de faire cela.
' Create a process to run the DOS command in
Dim oProcess As New System.Diagnostics.Process
' Fill in the DOS command details
oProcess.StartInfo.FileName = sExeName
oProcess.StartInfo.Arguments = sArguments
oProcess.StartInfo.UseShellExecute = False
oProcess.StartInfo.CreateNoWindow = True
oProcess.StartInfo.RedirectStandardOutput = True
' Run the DOS command
oProcess.Start()
' Set a timer and, if the process doesn't complete in time, kill it
Dim bSuccess As Boolean = oProcess.WaitForExit(1000 * iTimeoutSeconds)
' If the process completed in time
If bSuccess Then
' Create a StreamReader to read the output from the DOS command
Dim oOutputStream As System.IO.StreamReader = oProcess.StandardOutput
' Create a simple string to hold the output from the DOS command
Dim sOutput As String = oOutputStream.ReadToEnd()
' Create an integer to hold the exit code from the DOS command
Dim iExit As Integer = oProcess.ExitCode
< … Do something with the results … >
End If

Sv translation
languageja

外部プログラムを実行してコードを編集することにより、ルール内のプロセスをチェックできます。
この操作は、System.Diagnostics.Process クラスによって可能になります。
' Create a process to run the DOS command in
Dim oProcess As New System.Diagnostics.Process
' Fill in the DOS command details
oProcess.StartInfo.FileName = sExeName
oProcess.StartInfo.Arguments = sArguments
oProcess.StartInfo.UseShellExecute = False
oProcess.StartInfo.CreateNoWindow = True
oProcess.StartInfo.RedirectStandardOutput = True
' Run the DOS command
oProcess.Start()
' Set a timer and, if the process doesn't complete in time, kill it
Dim bSuccess As Boolean = oProcess.WaitForExit(1000 * iTimeoutSeconds)
' If the process completed in time
If bSuccess Then
' Create a StreamReader to read the output from the DOS command
Dim oOutputStream As System.IO.StreamReader = oProcess.StandardOutput
' Create a simple string to hold the output from the DOS command
Dim sOutput As String = oOutputStream.ReadToEnd()
' Create an integer to hold the exit code from the DOS command
Dim iExit As Integer = oProcess.ExitCode
< … Do something with the results … >
End If