c How to put a program in the background to execute!

Updated on technology 2024-04-14
9 answers
  1. Anonymous users2024-02-07

    To put it simply, after the query is submitted, a background thread is established, the query is executed, and the response is returned (at this time, the background thread is performing the query operation and saving the progress in the session, db or file).

    After returning, a progress bar pops up, which continuously fetches progress from the background and is displayed in the progress bar (here the progress can be obtained with ajax or with a scheduled refresh).

    When a background thread query ends, you can place the query results in a database or a temporary file, or simply in a session. Set a flag after the query ends, close the progress bar after obtaining the flag at the end of the query, and resubmit the page to get the query result and display it.

    The above methods can exist without relying on AJAX, and if you can use AJAX, it will be simple.

    There are two ways to submit ajax, one is that the foreground script goes down after the server is executed after the submission, and the other is that the foreground script goes down directly after the submission, and a function of the foreground script will be triggered after the submission has a result.

    In both cases, you can first pop up a progress bar to read the background execution progress, and write the progress continuously after the AJAX is submitted.

    There is a slight difference in the effect on the page in both cases.

    However, after the AJAX submission query, it is troublesome to modify the data on the page, so you can consider submitting the page after the AJAX submission is completed to obtain the query result.

  2. Anonymous users2024-02-06

    If it is, use AJAX technology.

    If it's a program, use multithreading or multi-process.

  3. Anonymous users2024-02-05

    You can put a progress bar so that the user doesn't think the program is dead!

    I think you should solve the problem at the root of the problem - reducing the time spent on queries, such as using stored procedures, views, etc., can greatly reduce the time spent on queries.

  4. Anonymous users2024-02-04

    Try it with Optimizer and set the CPU run to execute in the background.

  5. Anonymous users2024-02-03

    With multithreading, let the query you say run on a separate thread.

  6. Anonymous users2024-02-02

    It can be made a progress bar to show it.

  7. Anonymous users2024-02-01

    1. First install C and open it, as shown in the figure below.

    2. Then in the open C language, as shown in the figure below, click on the file in the upper left corner.

    4. Then in the window that opens, select Visual C, as shown in the figure below.

    5. Then select the console application, as shown in the image below.

    6. Finally, click OK, as shown in the figure below.

  8. Anonymous users2024-01-31

    Write two programs, first run the console, then the console opens the form program, and then the console closes itself.

  9. Anonymous users2024-01-30

    The following methods have been tested and are available.

    Start by adding a reference.

    using ;

    Then add the following at the beginning of the main method.

    dllimport("", entrypoint = showwindow", setlasterror = true)]

    private static extern bool showwindow(intptr hwnd, uint ncmdshow);

    static void main(string args) {process process = ;

    showwindow(, 0);Hide the console form.

    In this way, once the console program is started, the form will be automatically hidden and run in the background.

Related questions
16 answers2024-04-14

int main()

int i,j,a[100]; >>>More

24 answers2024-04-14

Create a process in IIS and let it execute it every night from 2 to 3 o'clock, and write the ** you want to operate in the executor of this process. >>>More

6 answers2024-04-14

The second line declares that the textbox control array ** is wrong and does not conform to the syntax specification! >>>More

17 answers2024-04-14

Use the copy function of the burning software.

P.S. Copy a disc with a recorder: It is very easy to copy a *** or CD disc with Nero burning software. >>>More

6 answers2024-04-14

The most critical first step in filling in the volunteer is to find the score ranking corresponding to your score and the total number of candidates in this position in the "one-point and one-paragraph table" to determine the position of the individual score in the province. >>>More