Secretarial knowledge > Graduation design

Design and Implementation of ASP.NET Website News Management System


【Abstract】The website news management system developed by ASP.NET and ADO.NET technology realizes the dynamic management of website news, which makes the management of information more timely and efficient, and improves work efficiency. At the same time, the development principle of the system, the functional characteristics of the system and the design scheme are introduced. [Keywords] ASP.NET ADO.NET News Management Database With the popularity of the Internet, more and more companies have established their own WWW website, companies can display products through the website, release the latest developments, communicate and communicate with users. , to establish contacts with partners, and to conduct e-commerce. The news management system is an important part of the corporate website. It plays a two-tiered role. It can be used to dynamically publish new products or new development projects. On the other hand, it can timely announce business performance and technology to customers. With engineering developments, special recommendations or preferential engineering projects, products and services to attract customers and expand customer base. There are two kinds of traditional website news management methods. One is a static HTML page. When updating information, you need to re-create the page and upload the page and modify the corresponding link. This method is not very efficient because it is too inefficient. The second is based on ASP and scripting language, the combination of dynamic web pages and databases, through the application to process news, which is currently more popular. However, due to the limitations of ASP itself, the system has some insurmountable defects, and the system performance of ASP.NET technology has been greatly improved, which is mainly manifested in the following aspects: 1. Since the ASP page has to go through the process of compiling and interpreting each time it is opened, the page does not have any speed improvement when it is repeatedly opened, and the ASP.NET page only needs to be recompiled after compiling once, until the page is modified or the web application is applied. The program restarts. This has led to a tremendous increase in speed over multiple visits. 2. Since ASP does not provide any component that outputs data as content, you can only use ADO's RecordSet object to read records one by one when using ASP to write database pages. ASP.NET can provide data library components such as DataGrid through ADO.NET. Contact the database directly. 3. ASP.NET supports real-time updates to applications. Administrators can update the application file without having to shut down the web server or even stop the application from running. The application file will never be locked, so the file can be overwritten even when the program is running. When the file is updated, the system will gently transition to the new version. 4. ASP.NET uses "code-behind" to write code that makes the code easier to write and has a clearer structure, reducing the complexity and cost of system development and maintenance. 1 system development principle 1.1 system structure model based on ASP.NET technology ASP.NET structure is a three-tier system: UI layer, business logic layer and data layer, as shown in Figure 1. Figure 1 ASP.NET system structure model The UI layer is responsible for interacting with the user, receiving user input and presenting data from the server to the client. The business logic layer is responsible for receiving the request from the browser and passing the request to the data layer, and sending the request processing result to the browser. It consists of web forms, XML web services, and component services. The Web form is the core of the ASP.NET application. It is the basis for presenting data and information to customers. It is also the basis for resounding and processing the information and data generated by the interaction between the client and the displayed Web form. The data layer provides data services for the transaction logic layer through ADO.NET manipulation data, such as storing data operation results, returning data retrieval results, and the like. 1.2 The principle of ADO.NET access database is connected with the database. ADO.NET provides the following three ways: through ODBC connection; through OLEDB connection; directly connected to SQL Server. The three methods make the efficiency from low to high and the independence from high to low due to the difference in the level of application. There are also two ways to process data in a connected database, one is to isolate the heterogeneous data source through the DataSet, and the other is to read from the data source in a stream. The traditional application is designed by establishing a connection to the database and maintaining the connection during the entire operation of the program. ASP.NET takes a data structure that is offline. When the browser requests a web page from the web server, the server processes the request and transmits the requested web page to the browser, and the connection is disconnected until the browser issues the next request. Another innovation in ADO.NET is the introduction of data sets. A data set is a high-speed buffer that provides a data graph in memory. Datasets know nothing about data sources, they can be generated and populated by programs or by importing data from a data warehouse. Regardless of where the data is obtained, the data set is manipulated by using the same program template and it uses the same potential data buffer. 2 System function design 2.1 System function structure The news management system can run on Windows 2000 Server operating system platform, Web server is IIS, database server is Microsoft SQL Server2000, development tool adopts Microsoft Visual Studio .NET and DreamWeaver. Figure 2 shows the functional structure of the system. The workflow is: user login is judged by permission, ordinary users can only browse, read and query news. In addition to the operations of ordinary users, registered users can also enter the news management module for news entry, modification and deletion. . Registered users can only delete and edit the news they have entered, except for the system administrator. 2.2 System features Simple operation and friendly interface: Full control of the page layout makes it easier to enter news; many options, including news categories, source departments, etc., can be completed with just a click of the mouse; in addition, tracking occurs. The prompt information also allows the user to be aware of their operation at any time. Instantly visible: The processing of the news will be immediately displayed in the corresponding column of the homepage, achieving the function of "immediate release, instant effect". Figure 2 System function structure diagram function is perfect: including all aspects of news management of common websites: news entry, browsing, deletion, modification, retrieval and other aspects, completely fulfilling the website's management requirements for instant news. Convenient porting: For different companies, only a little modification is required to develop a website news management system that suits the characteristics of the company! 3 System detailed design The main function of the system is realized by several function modules. The specific design process is as follows: (1) System login: This module is responsible for dividing users into common users and registered users to implement user license management. (2) News Browsing: This module is responsible for paginating the information of all news on the website, including title, type, source department field and release date. The title of each news is made into a hyperlink. Click on them to jump to the page for news. read. (3) News reading: Click on the title link on other pages to enter the news reading page. At this time, the detailed information of each news will be taken out, including content, title, keywords, etc., and placed in a relatively fixed format. In the area, all news uses roughly the same page layout, except that the content corresponding to each field is different. In addition, other parts of the page can dynamically place other components, such as website logo, page advertisement banner, etc., which can be easily Realize the reading effect of pictures and texts. (4) News inquiry: The module provides a news inquiry function, inputting the content to be searched and the selected classification information can quickly find the qualified news and output the query result. (5) News Management: This module is responsible for paginating the news information that the registered registered users have posted and has not deleted, and the user can delete and modify the news. Non-news publishers do not have permission to process the news other than the system administrator, so different users entering this page will display different content. (6) News entry and modification: The registered user enters the content required for a news, including the title, keyword, type, source department, release date, etc., and obtains the user name from the login module. This information will be saved in the database. . The module is also responsible for the update in the edit state, at which time it will initialize the page control based on the obtained Title field value. The following is an example of the system login page to give the main events and functions to illustrate the development process of the system. / / IsRegUserOk function: determine whether the user has registered and the password is correct public bool IsRegUserOk {string name = TextBoxName.Text.Trim; string pwd = TextBoxPassword.Text.Trim; / / create / open the database connection SqlConnection conn = new SqlConnection;conn.ConnectionString="server=;uid=sa;pwd=;database=jxdb";conn.Open;//Create sql character string string sql="select * from reg where name='"+name+"' ";SqlDataReader dr; SqlCommand cmd=new SqlCommand; dr=cmd.ExecuteReader; / / retain user registration or not information bool isRegUserExist = dr.Read; / / close DataReaderdr.Close; / / get the password of the user name string sqlBoth=" Select * from reg where name='"+name+"'";sqlBoth+="and pwd='"+pwd+"'";SqlCommand cmdBoth=new SqlCommand;SqlDataReader drBoth;drBoth=cmdBoth.ExecuteReader;//Keep username + The password exists at the same time bool isBothExist=drBoth.Read; / / close DataReaderdrBoth.Close; conn.Close; / / determine whether the user registered if{Response.Write"); return false;} / / determine whether the user name and password are consistent else If{Response.Write");return false;}elsereturn true;} last The system back-end data storage scheme is given: the database and its stored procedures are built using Microsoft SQL Server 2000. Here are two required data tables. One is that the data table News contains fields: number, name, title, keyword, content, type, source department, and date. The fields are as follows: Second, the data table Reg contains fields: number, name, password, department, e-mail address and telephone number. The description of the field is as follows: References [1] Tianji Network New Technology Research Office. "ASP.NET Complete Introduction". Chongqing Publishing House, 2001 [2] Scott Worley. "ASP.NET Technology Insider". Wang Wenlong Liu Xiangning translation. People Posts and Telecommunications Press, 2002 [3] Sanjeev Rohilla, Senthil Nathan, Surbhi Malhotra. "ADO.NET Professional Project Development". Chen Jun Wang Baoliang translation. China Water Resources and Hydropower Press, 2003 [4] Ding Yuchun Wang Yufen. Website Design and application of news release management system. Modern library and information technology. 2002, 5

recommended article

popular articles