zoukankan      html  css  js  c++  java
  • ASP 基础二 内置对象

    一 Request

    二 Response

    三 Application

    四 Session

    五 Server

    <script language="vbscript" runat="server">
    
    Sub Application_OnStart
    Application("applicationname")="mytest"
    End Sub
    
    Sub Application_OnEnd
    Application("applicationname")="mytest2"
    End Sub
    
    
    Sub Session_OnStart
    Session("mysession")="1111"
    End Sub
    
    Sub Session_OnEnd
    Session("mysession")="2222"
    End Sub
    
    </script>
    <html>
    <head title="test hello world">
    </head>
    <%
        Application.Lock()
        application("test")="abcd"
        session("test")="abcde"
        Application.UnLock()
        
        response.Write(application("applicationname"))   
        response.Write(application("applicationname2"))  
        response.Write(session("mysession"))    
    
        
        
     %>
    <% 
        dim a
        dim b
        a=Request.Form("fname")
        b=Request.Form("lname")
           
        response.Write(a+"<br/>"+b+"<br/>") 
        response.Write(Request.Form.Count)
        response.Write(request.QueryString("para"))
        response.Write(request.Cookies("test"))
        response.Write(request.ServerVariables("server_name")+"<br/>")
        response.Write(request.ServerVariables("request_method")+"<br/>")
    %>
    <%
        dim c
        
         
        
        response.Buffer=true
        response.CharSet="gb2312"
        response.ContentType="text/html"    
        response.Write("hello world")
        response.Cookies("test")="helloworld"
        response.Flush()
        response.End()
        response.Clear()
        response.Redirect("www.baidu.com")
     %>
    <body>
        <form method="post" action="testRequest.asp?para=param121">
            <p>
                First Name:
                <input type="text" name="fname" />
            </p>
            <p>
                Last Name:
                <input type="text" name="lname" />
            </p>
            <input type="submit" value="Submit" />
        </form>
    </body>
    
    
    </html>
    <html>
    <head title="test hello world">
    </head>
    <body>
        <%
            dim a
            
            response.Write(Server.URLEncode("我的-8*&^%$%"))
            response.Write("aaaa<br/>bbbb")
            response.Write(Server.HTMLEncode("aaaa<br/>bbbb"))
    
            response.Write(Server.MapPath("index.asp"))
        %>
    </body>
    
    
    </html>
    天生我材必有用,千金散尽还复来
  • 相关阅读:
    经典算法系列二-归并排序
    经典算法系列一-快速排序
    u-boot,linux,文件系统移植笔记1
    ARM函数调用时参数传递规则
    内核移植 nand分区
    LINUX的patch文件打patch
    idea插件使用
    socket通信同步通信,异步通信
    今天学了一个很简易的测试数据库是否连接成功
    wpf中TreeView的使用
  • 原文地址:https://www.cnblogs.com/ligenyun/p/7611089.html
Copyright © 2011-2022 走看看