In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
Editor to share with you IE and SQL2k to develop a XML chat program example analysis, I believe that most people do not know much about it, so share this article for your reference, I hope you will learn a lot after reading this article, let's go to know it!
Years of competition between different browsers has led to the emergence of many tools to help developers accomplish tasks that were previously difficult to do. Now, with a short script, you can create an application that binds data to a user control so that you can communicate with the server through an embedded proxy type control.
In Internet Explorer (IE), these include xml data islands and xmlhttp objects, which are used to bind data to form elements, and XMLHTTP objects to create synchronous and asynchronous calls to the server without navigating to other pages within the current page. I'll use these two easy-to-use features to create a simple chat application that consists of asp pages that act as UI, javaScript that implements client-side functions, and T-SQL that completes business logic in SQL Server 2000.
Clients and servers use XML to communicate. After the Web server receives a message block, the message block is appended to a timestamped MESSAGES table in SQL Server. Based on a predefined time interval, the customer requests updated information from the server, including the list of messages and online users that have been appended to the database since the last request from the server.
The customer will send one to the server through the XMLHTTP object. The action either requests to refresh the message and the list of users, or sends a new message. These actions are saved in a table called ACTIONS. The server will respond to the appropriate request or accept a new message and append it to the MESSAGES table.
When the server responds to a request for a message, it returns a list of all new messages since the last request. To track customer activity, I use an ACTIVITY table that contains the date and time (datetime) of the customer activity, and the customer's identity is stored in the table HANDLES, whose name is intuitive.
Here is the script for creating the table:
CREATE TABLE [dbo]. [ACTIONS] ([action_id] [int] IDENTITY (1,1) NOT NULL, [action_name] [varchar] (50) NULL, [action_descr] [varchar] (255) NULL) ON [PRIMARY] GOCREATE TABLE [dbo]. [ACTIVITY] ([handle_id] [int] NULL [action_time] [datetime] NULL) ON [PRIMARY] GOCREATE TABLE [dbo]. [HANDLES] ([handle_id] [int] IDENTITY (1,1) NOT NULL, [handle] [nvarchar] (63) NULL) ON [PRIMARY] GOCREATE TABLE [dbo]. [MESSAGES] ([msg_id] [int] IDENTITY (1,1) NOT NULL, [message] [nvarchar] (255) NULL, [action_id] [int] NULL [action_time] [datetime] NOT NULL) ON [PRIMARY]
All data operations will be done through stored procedures. All data interfaces will be done through a generic COM that acts as a liaison between the Web server and SQL Server 2000. The COM object exposes a method RunSPReturnStream that I want to use. The first parameter of the method is the name of the stored procedure, and the second parameter is an array of parameters. The parameter array is a simple array in the following format: (paraName, paramType, paramLength, paramValue). ParamType is one of the ADO Parameter Type enumerations. An ASP page is responsible for accepting actions and creating responses, which I call HandleAction.asp.
The chat page will contain an area showing chat messages; this area is a TABLE contained in DIV. This TABLE is bound to a xmlMessages XML data island. Another area shows the current user; this area is also a TABLE contained in DIV, which is bound to a xmlUsers XML data island. There is also a TEXTAREA for users to enter messages.
The above is all the contents of the article "sample Analysis of IE and SQL2k developing a XML chat Program". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.