易截截图软件、单文件、免安装、纯绿色、仅160KB

用ASP.NET做简易计算器和九九乘法表

简易计算器
 
 
1.在页面上放入TextBox控件和dropdownlist控件以及Button控件,形成下图的外观.
 
 
 
 
 
 
 
2.在做好页面后双击Button控件(即"="),写入如下代码:
 
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
 
public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
 
    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        double a = Convert.ToDouble(TextBox1.Text);//定义一个变量a,把TextBox1中的值赋给它
        double b = Convert.ToDouble(TextBox2.Text);//定义一个变量b,把TextBox2中的值赋给它
        /*定义的变量为浮点型*/
        if(DropDownList1.SelectedValue == "+" )//获取选择的运算符,确定运算类型
        {
            TextBox3.Text = Convert.ToString(a + b);
        }
        else if (DropDownList1.SelectedValue == "-")
        {
            TextBox3.Text = Convert.ToString(a - b);
        }
        else if (DropDownList1.SelectedValue == "*")
        {
            TextBox3.Text = Convert.ToString(a * b);
        }
        else if (DropDownList1.SelectedValue == "/")
 &nbs


相关文档:

ASP.NET 登录界面

//default.aspx.cs
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Data.OleDb;
using System.Data.SqlClient;
using System.Runtime.InteropService ......

ASP.NET中背景音乐的处理

在ASP.NET的SOUCE中,不会存在BGSOUND这个标签,但是,如果我想插入一段背景音乐怎么办?
我这里有两种解决方法:
1、写入一个网页播放器,但是这样,本人认为很复杂,而且,我也不会
2、用IFRAME嵌套一个HTML网页,将IFRAME的的WIDTH和HEIGHT都设置成0PX,即可。 ......

asp.net(c#)数据类型格式转换大全

1、DateTime   数字型 
       System.DateTime currentTime=new System.DateTime(); 
  1.1 取当前年月日时分秒 
       currentTime=System.DateTime.Now; 
  1.2 取当前年 
   &nb ......

ASP.NET Session丢失问题原因及解决方案

正常操作情况下会有ASP.NET Session丢失的情况出现。因为程序是在不停的被操作,排除Session超时的可能。另外,Session超时时间被设定成60分钟,不会这么快就超时的。
现在我就把原因和解决办法写出来。
ASP.NET Session丢失原因:
由于Asp.net程序是默认配置,所以Web.Config文件中关于Session的设定如下:
< sessi ......

详解VS2010中ASP.NET @Page指令属性

@Page指令位于每个ASP.NET页面的顶部,告诉ASP.NET这个具体页面使用什么属性,以及该页面继承的用户控件。ASP.NET页面
@Page指令属性有:AspCompat、Async、AsyncTimeout、AutoEventWireup、Buffer、
ClassName、ClientIDMode、CodeBehind、
CodeFile、CodeFileBaseClass、CodePage、CompilationMode 、ContentType、 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号