ASP full lecture ~~ huh

xiaoxiao2021-03-06  75

ASP full lecture ~~ Hehehe ~ Summer vacation, I want to give birth! ... -% ¥% ... ¥¥ # ... - *

For our Flash, slightly learn the ASP ~ (To bear it ~) Because this thing is actually useful, it is quite big. Or is it explained as an example as an example. This time, we use the ASP, so it is more clear about the contrast of Flash's Action, I also try to make the basics of the two, and the advantages of the ASP will be out of date! ^ _ ^

Sorry, first, you must go to ASP's grammatical class. (Hello, learning is actually not bad, don't lose something!)

Because ASP uses VB Script and JScript, there are <% and%> in the ASP format, which is the simplest combination of Scripts

Methods.

First, a lot of people have been touched, familiar with:

Hello World </ title> </ head></p> <p><body></p> <p><%</p> <p>Response.write ("Hello World!")</p> <p>%></p> <p></ body></p> <p></ html></p> <p>The above is the simplest Hello World Example, his role is to output a Hello World to the browser. You can see that ASP only uses one sentence, which is <% response.write ("Hello World!")%> . The response here is one of the basic five major objects of the ASP, in fact, the Document.Write feature in RESPONSE.WRITE and JavaScript is the same - all output to the browser. As for html, I think I don't want to say it ~~</p> <p>Ok, let me talk about the five major objects of the ASP. These things can be used for websites. I am like a questionnaire, counter, password verification, dynamic collection user information, etc., how, is it? Oh ~</p> <p>Let's start with Response.</p> <p>1. Response.write</p> <p>The most commonly used is the response.write we used, this thing will make the browser output. Because of common use, it is simplified by Gates old. That is, <% response.write ("Hello World!")%> Can be short-handed into <% = ("Hello World")%>.</p> <p>2. Response.Redirect</p> <p>This is our common website steering function. Need not to pay attention to anything to the browser before response.Redirect, (of course, html) this is because response.redirect is the next command to let the browser action, and response.write or html is to make your browser Things, this creates a conflict.</p> <p>The syntax is simple: response.redirec "ab";</p> <p>AB here is the page you want to turn to "* .htm (ASP, SWF, JSP, PHP ...)"</p> <p>But remember this is ASP, don't forget to add <% and%> two brothers.</p> <p>3.Response.end</p> <p>Ha ha ~ too simple, this is to stop to the browser.</p> <p>This time I came here ~ The next four major objects were left. Ha ha ~ I hope to continue to pay attention ~</p> <p>Ok, pick up the section. Today is going to say the request of the four objects of the ASP.</p> <p>Request is more important to get data from the client. I think this is also the main use of most websites.</p> <p>There are three ways: request.form / request.QueryString and Request. Let's take a look at the Form method.</p> <p>This method is a common method of ASP because the table is indeed a good way to get user information. FORM has two different submission methods, one is POST, the other is Get. Where did you have seen it? Looking at the eyes? Yes, the third election in Loadvariables in Flash is not "post" or "get"? Yes, I have to use this loadvariables in the future.</p> <p>for example:</p> <p>TEA.ASP: Collection Information</p> <p><html></p> <p><head> <title> Collect infread </ title></p> <p></ hEAD></p> <p><body></p> <p><form action = "tea1.asp" method = "post"> Here mean to hand over the table to Tea1.asp;</p> <p><p> name: <input type = "text" Name = "name"> </ p> Note: All elements should be in the middle of the <form> </ form> tag;</p> <p><p> password: <input type = "text" Name = "password"> </ p></p> <p><p> input type = 'submit "name =" a "value =" submit "> </ p> joins Submit Button (Submitting New)</p> <p></ form></p> <p></ body></p> <p></ html></p> <p>TEA1.ASP: Feedback Information</p> <p><html></p> <p><head> <title> The infread </ title></p> <p></ hEAD></p> <p><body></p> <p><center> Hello! </ center></p> <p><% = Request ("Name")%> Your password is <% = request ("password")%> <% = is the last talk about RESPONSE.WRITE, output to the browser</p> <p></ body></p> <p></ html></p> <p>Ha ha ~~ After reading it! (nonsense!:)</p> <p>The main purpose of this thing is to get the user's username and password, then display the information of the user from Tea1.asp. Very simple, everyone can see the use of Request, that is</p> <p>Request ("Table Element");</p> <p>Look, we have just finished the ASP two objects, you can do network investigations! Ha ha ~ tomorrow will be more useful objects, you will find that with the deepening of the study of the ASP object, you will become ------ Network Superman! Oh, joke</p> <p>Concealed the festival, we have learned the Application object today. This is the third largest object of ASP.</p> <p>This Application object ~</p> <p>For Application, it is a shared object, a common object of all online personnel, you can modify its value to adapt to your needs. Suppose your website creates an ASP, then you start an application. It is a very important object that can help us to realize chat rooms and web patterns. It is now speaking about Application.</p> <p>It is the custom property of Application. Admin can define properties to Application according to your needs. It is worth noting that Once the Application is executed, it will be saved on the server, which does not disappear because the user's leave. Let's take an example to see how the ASP does Counter.</p> <p>app.asp:</p> <p><%</p> <p>Application.lock</p> <p>Application ("count") = application ("count") 1</p> <p>Application.unlock</p> <p>%></p> <p><Html></p> <p><HEAD></p> <p><Title> Page Counter </ Title></p> <p></ hEAD></p> <p><body></p> <p><p align = "center"> Welcome! You are the <% Application ("count")%> here! </ p></p> <p></ body></p> <p></ html></p> <p>Ok, everyone can see how the properties of Application are defined from above?</p> <p>Application ("Attribute Name")</p> <p>You can then achieve any function ~ (but in the ability of the ASP's ability) Oh, Application.lock and Application.unlock are first locking the Application and then release. To prevent two users to modify at the same time, there may be errors.</p> <p>Then we modify this program, you can do our Flash counter!</p> <p>Open Flash, create a new file, write Welcome, you are the here!</p> <p>In Layer2 (Layer1 Air), add Dynamic Text, named Count.</p> <p>Write AS in Layer2 Frame1:</p> <p>MM_INSERT = "True"; A variable of ASP, here is True, to ensure the next load</p> <p>Loadvariables ("App.asp", "", "POST");</p> <p>Count = Application ("count");</p> <p>Oh ~ Ok, try it ~ But you don't forget to put app.asp and your swf in your IIS or PWS default directory ~ If you don't show it, you will come out ~</p> <p>Today is round to the old four-pull - assion object.</p> <p>Session object, so the name, is an object that is talking to the visitor. Every visitors will receive a unique session, saving the user's information, some applications of the website ~ like a shopping cart, in me, it is like a small package.</p> <p>Because of the privateness of the session object, compare with Application, there is a short life of its survival - from a user to the user's departure, not Forever with you, so it is very easy to use.</p> <p>Take a look at a small example of an id for a visiting buddy:</p> <p>id.asp</p> <p><html></p> <p><HEAD></p> <p></ hEAD></p> <p><body></p> <p><br> iD is <% = session.SessionID%> </ body></p> <p></ html></p> <p>How, ASP is getting a sentence ~ Don't explain it? The sessionid here is an attribute of the session. In fact, it is a Counter.</p> <p>Its custom attributes are the same as Application.</p> <p>Session ("Attribute Name" =;</p> <p>Simple, no way is simple ~</p> <p>Ok ~ it's the application:</p> <p>Simple password verification:</p> <p>Password.asp</p> <p><html></p> <p><HEAD></p> <p></ hEAD></p> <p><body></p> <p><% session ("name") = "Anders" session ("password") = "1234"%></p> <p></ body></p> <p><html></p> <p>Password storage file</p> <p>Check.asp</p> <p><html></p> <p><HEAD></p> <p></ hEAD></p> <p><body></p> <p><% @ Language = VBScript%></p> <p><% Response.expires = -1%> Once the page is open, it is expired to prevent the browser back to display</p> <p><% Response.buffer = true> This line is open page buffer</p> <p><form></p> <p><p> name: <input type = "text" Name = "name"> </ p></p> <p><p> password: <input type = "text" Name = "password"> </ p></p> <p><p> input type = 'submit "name =" a "value =" submit "> </ p></p> <p></ form></p> <p><% If name = session ("name") and password = session ("password") THEN</p> <p>Response.write "please come in!"</p> <p>Else</p> <p>Response.write "Error!"%></p> <p></ body></p> <p></ html></p> <p>Test file</p> <p>Oh ~ For everyone, should there be no difficulty? This is a thought of a flash password verification in the past few days. You can see how simple is the ASP ~ (Xiao Zhuzhu quietly appears behind the back, holding a knife (kitchen knife) ~ Your kid does not want to mix in the Action area ! :))</p> <p>The final final chapter: (It is also the most simple but the most important thing we have to apply): Server object.</p> <p>Server object is VBScript to establish the source of the ActiveX object, the Server object allows us to use ActiveX on the server side.</p> <p>Ok, let's take a look at a few practical:</p> <p>Server.mappath:</p> <p>what? never seen it? It's ok! Ha ha ~ You have to see what I still sell ~~</p> <p>The role of Server.MAPPath is to convert addresses on the network to the actual path of Server.</p> <p>Usage is Server.Mappath ("Your File"), don't forget to be in <%>> SERVER.HTMLENCODE:</p> <p>Output text in the HTML format. If you use this, the browser displays the text that does not decode the browser.</p> <p>Usage: Server.htmlencode ("Object you want to display"); what is real is full, just on BBS, showing message:</p> <p>Server.htmlencode ("Request.Form (" Subject ")) is fine ~</p> <p>Ok, another:</p> <p>Server.createObject:</p> <p>It can be seen from the name to create an object.</p> <p>Usage is server.createObject ("Objects you want to build")</p> <p>example:</p> <p>Playing a database should be most familiar with this statement:</p> <p>Set conn = server.createObject ("adoDb.connection")</p> <p>Conn.open "drive = {Microsoft ACSESS DRIVER (*. MDB)}; dbq =" & Server.mAppath ("?. mdb")</p> <p>? mordb is your database file.</p> <p>Ha ha ~ I have five common objects of these ~ ASP, I will have a simple introduction to so much ~</p> <p>Is it necessary to combine the background database? Oh ~ After a few days, we learn ADO together ~</p></div><div class="text-center mt-3 text-grey"> 转载请注明原文地址:https://www.9cbs.com/read-109543.html</div><div class="plugin d-flex justify-content-center mt-3"></div><hr><div class="row"><div class="col-lg-12 text-muted mt-2"><i class="icon-tags mr-2"></i><span class="badge border border-secondary mr-2"><h2 class="h6 mb-0 small"><a class="text-secondary" href="tag-2.html">9cbs</a></h2></span></div></div></div></div><div class="card card-postlist border-white shadow"><div class="card-body"><div class="card-title"><div class="d-flex justify-content-between"><div><b>New Post</b>(<span class="posts">0</span>) </div><div></div></div></div><ul class="postlist list-unstyled"> </ul></div></div><div class="d-none threadlist"><input type="checkbox" name="modtid" value="109543" checked /></div></div></div></div></div><footer class="text-muted small bg-dark py-4 mt-3" id="footer"><div class="container"><div class="row"><div class="col">CopyRight © 2020 All Rights Reserved </div><div class="col text-right">Processed: <b>0.043</b>, SQL: <b>9</b></div></div></div></footer><script src="./lang/en-us/lang.js?2.2.0"></script><script src="view/js/jquery.min.js?2.2.0"></script><script src="view/js/popper.min.js?2.2.0"></script><script src="view/js/bootstrap.min.js?2.2.0"></script><script src="view/js/xiuno.js?2.2.0"></script><script src="view/js/bootstrap-plugin.js?2.2.0"></script><script src="view/js/async.min.js?2.2.0"></script><script src="view/js/form.js?2.2.0"></script><script> var debug = DEBUG = 0; var url_rewrite_on = 1; var url_path = './'; var forumarr = {"1":"Tech"}; var fid = 1; var uid = 0; var gid = 0; xn.options.water_image_url = 'view/img/water-small.png'; </script><script src="view/js/wellcms.js?2.2.0"></script><a class="scroll-to-top rounded" href="javascript:void(0);"><i class="icon-angle-up"></i></a><a class="scroll-to-bottom rounded" href="javascript:void(0);" style="display: inline;"><i class="icon-angle-down"></i></a></body></html><script> var forum_url = 'list-1.html'; var safe_token = 'QisZB1MkerzxmFzj4GV3f0PVEL27x9A0qAgg1Y_2F_2B24loSy8eycBWAwBhIDCCmwJokZgS1o0eQAcHWLqHXD_2Bnpg_3D_3D'; var body = $('body'); body.on('submit', '#form', function() { var jthis = $(this); var jsubmit = jthis.find('#submit'); jthis.reset(); jsubmit.button('loading'); var postdata = jthis.serializeObject(); $.xpost(jthis.attr('action'), postdata, function(code, message) { if(code == 0) { location.reload(); } else { $.alert(message); jsubmit.button('reset'); } }); return false; }); function resize_image() { var jmessagelist = $('div.message'); var first_width = jmessagelist.width(); jmessagelist.each(function() { var jdiv = $(this); var maxwidth = jdiv.attr('isfirst') ? first_width : jdiv.width(); var jmessage_width = Math.min(jdiv.width(), maxwidth); jdiv.find('img, embed, iframe, video').each(function() { var jimg = $(this); var img_width = this.org_width; var img_height = this.org_height; if(!img_width) { var img_width = jimg.attr('width'); var img_height = jimg.attr('height'); this.org_width = img_width; this.org_height = img_height; } if(img_width > jmessage_width) { if(this.tagName == 'IMG') { jimg.width(jmessage_width); jimg.css('height', 'auto'); jimg.css('cursor', 'pointer'); jimg.on('click', function() { }); } else { jimg.width(jmessage_width); var height = (img_height / img_width) * jimg.width(); jimg.height(height); } } }); }); } function resize_table() { $('div.message').each(function() { var jdiv = $(this); jdiv.find('table').addClass('table').wrap('<div class="table-responsive"></div>'); }); } $(function() { resize_image(); resize_table(); $(window).on('resize', resize_image); }); var jmessage = $('#message'); jmessage.on('focus', function() {if(jmessage.t) { clearTimeout(jmessage.t); jmessage.t = null; } jmessage.css('height', '6rem'); }); jmessage.on('blur', function() {jmessage.t = setTimeout(function() { jmessage.css('height', '2.5rem');}, 1000); }); $('#nav li[data-active="fid-1"]').addClass('active'); </script>