Recommended: Guide to IIS Server and web.config configuration optimization 1. Modify the maximum number of IIS work processes a. Please consider the following points: 1. Each worker process consumes system resources and CPU occupancy; too many worker processes will cause a sharp consumption of system resources and CPU utilization; 2. Each worker process has its own state data. If the web application depends on the worker process to save state data, it may not support the use of multiple work.
The ASP Cookies tutorial uses to record user browsing and other information, but cookies can only save information to the client, but it is not safe. Many simple voting cookies are used.
The same ASP session, ASP technology cookies are used to store information specific visitors to your website. This cookie is stored on the user's computer for how long it takes to extend. If you set the validity period for a cookie on a future day, it will continue before their day arrives, unless the user is manually deleted.
If you have read through session class you will find that the code for ASP cookies has several similarities with ASP sessions.
Cookies created by ASP technology
Creating an ASP Cookie is the exact same process, creating an ASP session. Again, you have to create a key/value pair there. The key to that will be the cookie created by our name. The cookie created will store the value that contains the actual data.
In this example, we will create a cookie called Brownie to store how much brownie we eat during the day.
<%
'create the cookie
Response.Cookies(brownies) = 13
%>
Now that we have established this cookie, how do we get this information from the user's computer?
ASP technology search for cookies
In order to store our information in cookies, we must use the ASP request object, which provides a good method for the cookies we capture to be stored on the user's computer. Below, we pick up our cookies and print out their value.
<%
Dim myBrownie
'get the cookie
myBrownie = Request.Cookies(brownies)
Response.Write(You ate & myBrownie & brownies)
%>
Note: Be sure to see that when you create a cookie, you use Response.Cookies , but when you retrieve a cookie you use Request.Cookies .
Cookie expiration date for ASP technology
With real life cookies, in the ASP you can set how long you want your cookies to stay fresh and live on the user's computer. A cookie expiration date can be held; on this date, the specified cookie will be destroyed.
In our example below we create a cookie that adds a good 10-day first consideration to the current date to it 10 more.
'create a 10-day cookie
Response.Cookies(brownies) = 13
Response.Cookies(brownies).Expires = Date() + 10
'create a static date cookie
Response.Cookies(name) = Suzy Q.
Response.Cookies(name).Expires = #January 1,2009#
Cookie arrays or collections of ASP technology
Until now, we can only store a variable to a cookie, which is quite limited if you want to store a lot of information. However, if we collect this variable, it can store a large amount. Below we make brownies collections to store various information.
'create a big cookie
Response.Cookies(brownies)(numberEaten) = 13
Response.Cookies(brownies)(eater) = George
Response.Cookies(brownies)(weight) = 400
ASP technology searched for cookie values
Now iterate through the collection of brownies, we will use each loop. See our closed loop tutorial for more information.
<%
For Each key In Request.Cookies(Brownies)
Response.Write(<br /> & key & = & _
Request.Cookies(Brownies)(key))
Next
Response.Cookies(brownies)(numberEaten) = 13
Response.Cookies(brownies)(eater) = George
Response.Cookies(brownies)(weight) = 400
%>
Share: Asp limits upload file size instance A model uses the asp file upload component to upload a file to the server to determine whether the file size exceeds the specified size. This example talks about the upload_5xsoft file upload component. File.filesize1000000 can limit the number of k files to. dim upload,file,formname,formpath,icount,filename,fileext set upload=new upload_5xsoft