zoukankan      html  css  js  c++  java
  • aspx开发方式

    html的

    <html>
    <head></head>
    <body>
    今天天气还不错,据说一会要下雨
    
    
    </body>
    
    
    </html>

    C#不连接数据库

    <%@ language="C#" %>//1、告诉他用到的语音
    <html>
    <head></head>
    <body>
    // DateTime.Now //2如果不写1会直接显示DateTime.Now。执行1,2变成3
    <%= DateTime.Now %>//3、如果是html显示<%@ language="C#" %><%= DateTime.Now %>,执行4、把后缀成axps
    
    <%
        if( DateTime.Now.Hour>12)
            {%>
            xiawu
            %<}
            else
            {%>
            shangwu
            %<}
    
    %>
    </body>
    
    
    </html>

    C#连接数据库

    <%@ language="C#" %>//1、告诉他用到的语音
    <%@import namespace ="System.Data.SqlClient" %>//2、引用命名空间
    <html>
    <head></head>
    <body>
    <table>
    <tr>
        <td>用户名</td>
        <td>密码</td>
        <td>昵称</td>
        <td>性别</td>
        <td>民族</td>
    </tr>
    <%
        SqlConnection comm = new SqlConnection("server=.;database=Date0504;user=sa;pwd=y920106k");
        SqlCommand cmd = conn.CreateCommand();
        cmd.CommandText="select * from Users";
        conn.Open();
        SqlDataReader dr = cmd.ExecuteReader();
        while(dr.Read())
        {
        %>
            <tr>
                <td><%= dr["UserName"]%></td>
                <td><%= dr["PassWord"]%></td>
                <td><%= dr["NickName"]%></td>
                <td><%= dr["Sex"]%></td>
                <td><%= dr["Nation"]%></td>
            </tr>
            conn.Close();
    
        <%
        }
    %>
    
    </table>
    </body>
    
    
    </html>
  • 相关阅读:
    zookeeper编译环境搭建
    windows下zookeeper安装并发布成windows服务
    ScheduledThreadPoolExecutor源码
    AbstractExecutorService源码
    FutureTask源码2
    FutureTask源码
    ThreadPoolExecutor源码2
    ThreadPoolExecutor源码1
    二进制转10进制
    Android ANR Waiting because no window has focus问题分析
  • 原文地址:https://www.cnblogs.com/skyhorseyk/p/7283104.html
Copyright © 2011-2022 走看看