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类库有一定的 ......
在项目中我要用到修改密码功能,修改密码页我是用模式对话框的形式弹出来的,当我按正常情况提交数据时,发现它会弹出一个新的窗口来显示修改成功信息,我想提交数据而不打开新窗口,
我的解决办法就是在head标签中加上base标签让target="_self",之前我想得有点复杂,想给它一个固定的alert,当成功修改时才显示 ......
asp.net中显示在线用户
private static System.Threading.Timer timer;
private const int interval = 1000 * 60 * 20;//检查在线用户的间隔时间
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;
public Global()
{
Initialize ......
People often ask me for guidance on how they can dynamically "re-write" URLs and/or have the ability to publish cleaner URL end-points within their ASP.NET web applications. This blog post summarizes a few approaches you can take to cleanly map or rewrite URLs with ASP.NET, and have th ......