How Can We Help?
< All Topics
Print

How to Stop Application by script


Purpose of this article

This article aims to show how to stop an application in runtime mode by script.

1. Stopping the Application in Runtime Mode

There are two ways to stop an application in runtime mode. Using ADISRA SmartView function, or closing the “Runtime” process by windows system. Below will be shown the two ways.

1.1 By System Function

  1. Create a screen and insert a new button. In the button’s script, use the function “SVApplications.StopApp();” and then run the application to test.

1.2 By Windows Process

  1. Create a screen and insert a new button. In the navigation tree, click on the “User Functions Library” and create a new document.
  1. Save the new function with the name “Stop”.
  1. Insert the following script inside the new document.
void CloseRuntime()
{
    foreach (var process in System.Diagnostics.Process.GetProcessesByName("Runtime"))
    {
        process.Kill();
    }
}
  1. Now, create a new screen, insert a button. In the button script, call the created user function. To call the function, type the following script in the button’s script area: “Stop.CloseRuntime();
  1. Save the application and start the application in runtime mode and test it.

Leave a Reply

Your email address will not be published. Required fields are marked *

eighteen − two =

Table of Contents