asp.net 中日期和时间的格式化
这也许是一个小问题 但是有很多学问 不能眼高手低 我把大部分情况列出来 给大家一个提醒
float str = 987654.32F;
//Response.Write(string.Format("{0:c}", str));
//this.Label1.Text = string.Format("{0:D}", str);
//this.Label1.Text = string.Format("{0:C}", str);
Response.Write("<h1>日期格式化</h1>");
Response.Write("<br/>");
Response.Write("当前数字"+str);
Response.Write("<br/>");
Response.Write(string.Format("货币格式 {0:c}", str));
Response.Write("<br/>");
Response.Write(string.Format("科学技术法格式 {0:e}", str));
Response.Write("<br/>");
Response.Write(string.Format("科学计数法格式 12位有效数字{0:e12}", str));
Response.Write("<br/>");
Response.Write(string.Format("固定格式 {0:f}", str));
Response.Write("<br/>");
Response.Write(string.Format("固定格式 四位小数{0:f4}", str));
Response.Write("<br/>");
Response.Write(string.Format("常规格式 {0:g}", str));
Response.Write("<br/>");
Response.Write(string.Format("常规格式 六位有效数字{0:g6}", str));
Response.Write("<br/>");
Response.Write(string.Format("数字格式 {0:n}", str));
Response.Write("<br/>");
Response.Write(string.Format("数字格式 三位小数{0:n3}", str));
Response.Write("<br/>");
Response.Write(string.Format("十六进制{0:x}", 32));
Response.Write("<br/>");
Response.Write("<h1>日期格式化</h1>");
Response.Write("<br/>");
Response.Write("当前日期:" + System.DateTime.Now);
Response.Write("<br/>");
Response.Write(string.Format("短日期{0:d}", System.DateTime.Now));
Response.Write("<br/>");
Response.Write(string.Format("长日期{0:D}", System.DateTime.Now));
Response.Write("<br/>");
相关文档:
如何学习ASP.NET
2009-07-24 09:49
如果你已经有较多的面向对象开发经验,跳过以下这两步:
第一步 掌握一门.NET面向对象语言,C#或VB.NET。
我强烈反对在没系统学过一门面向对象语言的前提下去学ASP.NET。
ASP.NET是一个全面向对象的技术,不懂面向对象,那绝对学不下去!
第二步 对.NET Framework类库有一定的 ......
protected void Unite(GridView gv)
{
int i;
string LastType1;
int LastCell;
if (gv.Rows.Count > ......
[转]asp.net 母版页使用详解
母版页(扩展名是.master)
它的使用跟普通的页面一样,可以可视化的设计,也可以编写后置代码。与普通页面不一样的是,它可以包含ContentPlaceHolder控件,ContentPlaceHolder控件就是可以显示内容页面的区域。
代码如下:
<%@ Master Language="C#" AutoEventWireup="true" CodeFile=" ......
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;
using System.IO;
using Sy ......