This article is a mirror article of machine translation, please click here to jump to the original article.

View: 37223|Reply: 1

[Source] aspose.words to generate test papers

[Copy link]
Posted on 4/8/2016 4:44:24 PM | | |

Recently, I did an online paper grouping project. The main functions realize word typesetting, preview, and generate test papers. When it comes to word operations at the beginning, one thing that comes to mind is the office COM component to operate word. It took about two weeks to write the code for the entire system. Then I started to test repeatedly, and I felt good locally, and I was able to generate a word test paper smoothly, and the performance was okay. So I couldn't wait to release it to the server.

The first is that a component with CLSID {000209FF-0000-0000-C000-0000000046} in the COM factory fails due to the following error: 8000401a The system cannot start the server process because the configuration ID is incorrect. Please check the username and password. (Exception from HRESULT:0x8000401A).

First of all, all these problems are caused by permissions, and the solution is just to configure permissions. Not only useful for Excel and Word, but also for all Office products.

To get to the point, first, enter dcomcnfg in the run, open the component service manager->component service->my computer->DCOM-> find the corresponding Microsoft excel applicotion/Microsoft word 97-2003 document, and then right-click the attribute to activate the boot permission is enough to give it to OK. -------- no problem, this problem is solved.



Let's talk about the second situation "Performance problem": Since our system is the next subsystem of our website. So there is a certain user base. The system was accessed by a large number of users as soon as it went live. At the beginning, four or five hundred papers were grouped a day, and slowly the volume of papers became larger and larger, which was the beginning of problems with the system. The first is that there are many winWord.exe processes in the process. It can't end. Although the system code contains the Quit process and recycles resources, the problem is never solved. The consequence of a large number of winword.exe processes is that the server slows down. It should be particularly memory-intensive for this component.

There is no way to solve the problem. The last rogue was to write a timing service that killed the winword process that was not running. This treats the symptoms but not the root cause. 、



Here I want to say that Microsoft Office is a desktop office application software mainly developed for ordinary users, it has rich UI (user interface) elements, and is a set of pure local running software or client software. The Word automation interface is primarily designed to facilitate window application calls. For example, native applications developed by Delphi, VB, C# Winform, etc. Although it is possible to force Visible to be false and Word can run in server-side code, it still brings many tricky problems.

1. ASP.NET is based on B/S architecture. In the B/S architecture, user access is concurrent, which means that N users often make requests to a server page at the same time. In this case, the Word automation call will often die from time to time.

2. Due to the hidden interface operation, some interfaces that involve interfaces that can be successfully called in the window program will fail to call on the server side, or even crash, which will often lead to dead processes.

3. Because Word is a complex desktop program and does not meet the standards of general Web service programs for simplicity and efficiency, it is slow to run on the server side, and it will consume a lot of resources (CPU, memory), especially it cannot support a large number of users to access at the same time, and the resources will be exhausted quickly.

4. Most developers are relatively unfamiliar with COM technology, and there are often some code errors when programming and calling the Word interface, and it is difficult to check the problem, which is a frequent factor that causes dead processes. Word dead processes not only consume server resources but often cause server pages to fail to create new Word automation objects and continue to work. Some netizens proposed a dead process solution: programming to kill the dead process of Word, which is a practice of treating the symptoms but not the root cause, the dead process of Word is gone, but the abnormal closure of Word will cause many resources to be unable to be released in time. How long such a web server will last is hard to say.



In order to solve these problems, after comprehensive research and comparison, the author found that there is a component component aspose.words on the Internet, which completely eliminates the above problems and is recommended to share with you.



Below I will share some of the operation code of the aspose.words component with you in the hope that it will be helpful to those who need it





Original link: http://blog.csdn.net/fraing/article/details/8989736




Previous:[Help] If you want to build a website, you can html to help me modify the source code of the next single page. Ask for help
Next:Aspose.Words to generate PDF documents
Posted on 5/3/2020 9:07:08 AM |
Good post, helpful
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com