<span id="mktg5"></span>

<i id="mktg5"><meter id="mktg5"></meter></i>

        <label id="mktg5"><meter id="mktg5"></meter></label>
        最新文章專題視頻專題問答1問答10問答100問答1000問答2000關(guān)鍵字專題1關(guān)鍵字專題50關(guān)鍵字專題500關(guān)鍵字專題1500TAG最新視頻文章推薦1 推薦3 推薦5 推薦7 推薦9 推薦11 推薦13 推薦15 推薦17 推薦19 推薦21 推薦23 推薦25 推薦27 推薦29 推薦31 推薦33 推薦35 推薦37視頻文章20視頻文章30視頻文章40視頻文章50視頻文章60 視頻文章70視頻文章80視頻文章90視頻文章100視頻文章120視頻文章140 視頻2關(guān)鍵字專題關(guān)鍵字專題tag2tag3文章專題文章專題2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章專題3
        問答文章1 問答文章501 問答文章1001 問答文章1501 問答文章2001 問答文章2501 問答文章3001 問答文章3501 問答文章4001 問答文章4501 問答文章5001 問答文章5501 問答文章6001 問答文章6501 問答文章7001 問答文章7501 問答文章8001 問答文章8501 問答文章9001 問答文章9501
        當(dāng)前位置: 首頁(yè) - 科技 - 知識(shí)百科 - 正文

        ASP.NET內(nèi)置對(duì)象之Application對(duì)象

        來(lái)源:懂視網(wǎng) 責(zé)編:小采 時(shí)間:2020-11-27 22:44:56
        文檔

        ASP.NET內(nèi)置對(duì)象之Application對(duì)象

        ASP.NET內(nèi)置對(duì)象之Application對(duì)象:新建一個(gè)網(wǎng)站,包括兩個(gè)網(wǎng)頁(yè),代碼如下: 1、Index.aspx代碼: 代碼如下:<%@ Page Language=C# AutoEventWireup=true CodeFile=Index.aspx.cs Inherits=Index %> <!DOCTYPE html PUBLIC -
        推薦度:
        導(dǎo)讀ASP.NET內(nèi)置對(duì)象之Application對(duì)象:新建一個(gè)網(wǎng)站,包括兩個(gè)網(wǎng)頁(yè),代碼如下: 1、Index.aspx代碼: 代碼如下:<%@ Page Language=C# AutoEventWireup=true CodeFile=Index.aspx.cs Inherits=Index %> <!DOCTYPE html PUBLIC -

        新建一個(gè)網(wǎng)站,包括兩個(gè)網(wǎng)頁(yè),代碼如下:
        1、Index.aspx代碼: 
        代碼如下:
        <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Index.aspx.cs" Inherits="Index" %>
        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
        <html xmlns="http://www.w3.org/1999/xhtml" >
        <head runat="server">
        <title>無(wú)標(biāo)題頁(yè)</title>
        </head>
        <body>
        <form id="form1" runat="server">
        <div>
        <table style="width: 300px; height: 100px">
        <tr>
        <td style="width: 100px">
        用戶名:</td>
        <td style="width: 246px">
        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox></td>
        </tr>
        <tr>
        <td style="width: 100px">
        密    碼:</td>
        <td style="width: 246px">
        <asp:TextBox ID="TextBox2" runat="server" TextMode="Password"></asp:TextBox></td>
        </tr>
        <tr>
        <td style="text-align: center;" colspan="2">
        <asp:Button ID="Button1" runat="server" Text="登錄" OnClick="Button1_Click" /></td>
        </tr>
        </table>
        </div>
        </form>
        </body>
        </html>

        Index.aspx.cs代碼: 
        代碼如下:
        using System;
        using System.Data;
        using System.Configuration;
        using System.Collections;
        using System.Web;
        using System.Web.Security;
        using System.Web.UI;
        using System.Web.UI.WebControls;
        using System.Web.UI.WebControls.WebParts;
        using System.Web.UI.HtmlControls;
        public partial class Index : System.Web.UI.Page
        {
        string strInfo;
        protected void Page_Load(object sender, EventArgs e)
        {
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
        Application["Info"] = TextBox1.Text;
        strInfo = Application["Info"].ToString();
        if (TextBox1.Text == "admin" && TextBox2.Text == "admin")
        {
        Session["name"] = TextBox1.Text;
        Response.Redirect("Default.aspx?Info=" + strInfo + "");//地址欄的傳值
        }
        }
        }
        2、Default.aspx代碼:
        <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
        <html xmlns="http://www.w3.org/1999/xhtml" >
        <head runat="server">
        <title>無(wú)標(biāo)題頁(yè)</title>
        </head>
        <body>
        <form id="form1" runat="server">
        <div>
        <table style="width: 500px; height: 323px">
        <tr>
        <td colspan="2">
        <asp:TextBox ID="TextBox2" runat="server" Height="314px" Width="497px" TextMode="MultiLine"></asp:TextBox></td>
        </tr>
        <tr>
        <td>
        <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
        <asp:TextBox ID="TextBox1" runat="server" Width="390px"></asp:TextBox></td>
        <td>
         
        <asp:Button ID="Button2" runat="server" Text="發(fā)送" OnClick="Button2_Click" /></td>
        </tr>
        </table>
        </div>
        </form>
        </body>
        </html>
        Default.aspx.cs代碼:
        using System;
        using System.Data;
        using System.Configuration;
        using System.Web;
        using System.Web.Security;
        using System.Web.UI;
        using System.Web.UI.WebControls;
        using System.Web.UI.WebControls.WebParts;
        using System.Web.UI.HtmlControls;
        public partial class _Default : System.Web.UI.Page
        {
        protected void Page_Load(object sender, EventArgs e)
        {
        Label1.Text = Session["name"].ToString();
        /*對(duì)象的增加
        Application.Add("App1", "Value1");
        Application.Add("App2", "Value2");
        Application.Add("App3", "Value3");
        Response.Write("Application對(duì)象的使用");
        Response.Write("<br>");
        for (int i = 0; i < Application.Count; i++)
        {
        Response.Write("變量名:" + Application.GetKey(i));
        Response.Write(",值:" + Application[i] + "<p>");
        Response.Write("<br>");
        }*/
        }
        protected void Button2_Click(object sender, EventArgs e)
        {
        Application["content"] = TextBox1.Text;
        TextBox2.Text = TextBox2.Text + "\n" + Label1.Text + "說(shuō):" + Application["content"].ToString();
        }
        }

        聲明:本網(wǎng)頁(yè)內(nèi)容旨在傳播知識(shí),若有侵權(quán)等問題請(qǐng)及時(shí)與本網(wǎng)聯(lián)系,我們將在第一時(shí)間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

        文檔

        ASP.NET內(nèi)置對(duì)象之Application對(duì)象

        ASP.NET內(nèi)置對(duì)象之Application對(duì)象:新建一個(gè)網(wǎng)站,包括兩個(gè)網(wǎng)頁(yè),代碼如下: 1、Index.aspx代碼: 代碼如下:<%@ Page Language=C# AutoEventWireup=true CodeFile=Index.aspx.cs Inherits=Index %> <!DOCTYPE html PUBLIC -
        推薦度:
        標(biāo)簽: application asp ASP.NET
        • 熱門焦點(diǎn)

        最新推薦

        猜你喜歡

        熱門推薦

        專題
        Top
        主站蜘蛛池模板: 亚洲精品在线视频观看| 午夜在线亚洲男人午在线| 亚洲日韩乱码中文无码蜜桃| 亚洲一区在线视频| 黄色网址免费大全| 亚洲永久中文字幕在线| xxxxx免费视频| 亚洲成a人片在线看| 中文字幕手机在线免费看电影| 最近中文字幕免费2019| 精品亚洲麻豆1区2区3区| 337p日本欧洲亚洲大胆人人| a级毛片在线免费观看| 真实乱视频国产免费观看| 久久综合九九亚洲一区| 性色午夜视频免费男人的天堂| 国产猛烈高潮尖叫视频免费 | 亚洲成AV人在线观看天堂无码| 亚洲狠狠成人综合网| 毛片在线看免费版| 日韩亚洲人成网站| 中文字幕亚洲无线码| 在线观看免费无码专区| 亚洲影视一区二区| 在线观看91精品国产不卡免费| 亚洲最大在线视频| 最好免费观看韩国+日本| 成年免费a级毛片| 亚洲国产一区二区a毛片| 在线永久免费的视频草莓| 亚洲欧美aⅴ在线资源| 美女被免费喷白浆视频| 亚洲AV永久无码精品水牛影视 | 午夜精品在线免费观看| 日本高清不卡中文字幕免费| 亚洲国产精品无码专区在线观看| 亚洲大片免费观看| 免费无遮挡无码视频在线观看| 午夜亚洲AV日韩AV无码大全| a级日本高清免费看| 久久亚洲最大成人网4438|