ASP Getting Started Tutorial: ASP global variable Global.asa file
The Global.asa file is an optional file that can contain declared objects, variables, and methods that can be used on each page of an ASP application. ----------------------------
ASP Cookies
Cookies are often used to identify users.Example
Dim numvisitsResponse.Cookies ("NumVisits"). expires=date+365Numvisits=request.cookies ("NumVisits")
If numvisits= "" ThenResponse.Cookies ("NumVisits") =1Response.Write ("welcome!
You cannot view the ASP source code Select "View Source file" in the browser, you will only see the output of ASP files, which are pure HTML. This is because the script executes the results on the server before it is sent back to the browser.In our
ASP Introduction Tutorial: ASP request is a simple introduction, the ASP Request object is used to get information to the user. It has two ways of form and querystring,
Let's take a look at request.from here is specifically used for forms such as.
ASP several database connection way ' If you use the Foreign home page space, use the following statement: '' Rem codepage= ' 936 'Sqlkai=0Dim Sqldatabasename,sqlpassword,sqlusername,sqllocalnameSqllocalname= "(local)"Sqlusername= "Nntoa"Sqlpassword=
Public Sub Preventrefresh ()
Dim Refreshtime
Refreshtime = 20
If DateDiff ("s", Session ("Userrefreshtime"), now ()) Founderr = True
Response.Write " This page has the anti-refresh mechanism enabled, please do not & Refreshtime & "Second consecutive
Solution One:Configure the Access database tutorial driver and database file name in Web.config.Please look at the code
Get the Access database link string in the database access layer, such as OleDBHelper.cs.
/**////
' Procedure name: ShowPage' Function: Show "previous page next page" and other information' parameter: sfilename----link Address' Total number of totalnumber----' Maxperpage----number per page' Showtotal----Show total quantity'
The ASP realizes the picture to add the watermark code, wants to install the ASPJEPG component
Set Jpeg1=server.createobject ("Persits.jpeg")
Jpeg1.open Server.MapPath ("1.jpg") ' artwork
' Add watermark
Set Jpeg2=server.createobject
Site administrator can be based on the user's activities in the site and the legality of management, if the implementation is unbearable can delete the user, here is not to say is delete users can delete files, and so on, this is just a simple file
The documents are as follows:
Dim Vis
Set Js=createobject ("Scripting.FileSystemObject")
Set F=js.createtextfile ("D:/count.txt", True)
F.writeline 0
F.close
Whichfile=js.getfile ("D:/count.txt")
Set Thisfile=js.opentextfile (Whichfile)
Vis=thisfile.
Dim Voteid, Mychoose, I, Rs, SQLIf not IsObject (Conn) Then connectiondatabaseVoteid = CLng (Request ("Voteid"))If request.cookies ("Vote_" &voteid) = "Newaspvote_" &voteid ThenResponse.Write ("&back= has participated in the vote, thank
The code is as follows
Copy Code
Dim Voteid, Choose, Nowid, I, rs,sqlIf not IsObject (Conn) Then connectiondatabase If IsNumeric (Request ("Voteid")) ThenVoteid = CLng (Request ("Voteid"))ElseVoteid = 0End IfIf Voteid = 0 ThenSQL = "
"Pass form" objects submitted by a form G
' ET
If request.querystring.count>0 Then
Qstr= "?"
For each x in Request.QueryString
Qstr = qstr & x & "=" ' Write Name of Parameter
Qstr = qstr & Server.URLEncode (Request. QueryString (x)) & "&" ' Write
Today came up with the idea of using ASP to get all the table names in the database, the field names of all the tables, and the contents of all the fields in the database only if you know the names of the databases. After a period of time to query
Selecting records from an Access database is the most frustrating thing. They are input to the database in the order they are entered. Even if you use Sort By in the Access environment to change the record view, the record order in the data table
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service