I need a block of code that runs a job in the background. Suppose the user clicks the Submit button, then the task starts in the background, while the user closes this window and starts another task, and the task should continue.
Please provide some help with ASP.NET and VB.NET.
Many thanks for your help
You can take a look at the ThreadPool.QueueUserWorkItem method , which allows you to run some method on a thread drawn from a thread pool. Alternatively, you can use the Thread class to create a new thread manually, if it is a long-running task, to avoid the danger of a thread from a pool that contains a limited number of threads and which are also used to serve requests in ASP.NET applications.
You can do this by creating a Windows service hosting the wcf service, when the user clicks the submit button, you can send a request to the Windows service, and the Windows service will start in the background event when the user closes the window.
A BackgroundWorker . DoWork.
You can use BackgroundWorker , depending on your context.
BackgroundWorker will run in the background and can be easily used to synchronize updates with your GUI, if necessary.
Or use a parallel task library ...
Source: https://habr.com/ru/post/1780445/More articles:https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1780440/restrict-users-to-be-able-to-use-only-single-application-in-android-device&usg=ALkJrhjhLFXv8CD0mKN6uDbr8T34puvmXAmodify existing Android ROM to control user actions - androidMirroring / scrolling images in IE and transparency support - cssWhere to use Zend_Auth, in the model or controller? - phpC # convert viewstate to bool array - arraysSpring JMS and Oracle AQ - javaInline script conditional statement inside ListView - c #$ .ajax () does not work in any browser except Firefox - jqueryLocation of T4 Templates for Razor Views - asp.netВызов Java WS из .NET - путь Java использует Apache Rampart, эквивалент .NET - .netAll Articles