asp.net中System.DateTime.Now.ToString()的一些用法
Asp.net中的日期处理函数
//2009年4月24日
this.TextBox6.Text = System.DateTime.Now.ToString("D");
//2009-4-24
this.TextBox7.Text = System.DateTime.Now.ToString("d");
//2009年4月24日 16:30:15
this.TextBox8.Text = System.DateTime.Now.ToString("F");
//2009年4月24日 16:30
this.TextBox9.Text = System.DateTime.Now.ToString("f");
//2009-4-24 16:30:15
this.TextBox10.Text = System.DateTime.Now.ToString("G");
//2009-4-24 16:30
this.TextBox11.Text = System.DateTime.Now.ToString("g");
//16:30:15
this.TextBox12.Text = System.DateTime.Now.ToString("T");
//16:30
this.TextBox13.Text = System.DateTime.Now.ToString("t");
//2009年4月24日 8:30:15
this.TextBox14.Text = System.DateTime.Now.ToString("U");
//2009-04-24 16:30:15Z
this.TextBox15.Text = System.DateTime.Now.ToString("u");
//4月24日
this.TextBox16.Text = System.DateTime.Now.ToString("m");
this.TextBox16.Text = System.DateTime.Now.ToString("M");
//Tue, 24 Apr 2009 16:30:15 GMT
this.TextBox17.Text = System.DateTime.Now.ToString("r");
this.TextBox17.Text = System.DateTime.Now.ToString("R");
//2009年4月
this.TextBox19.Text = System.DateTime.Now.ToString("y");
this.TextBox19.Text = System.DateTime.Now.ToString("Y");
//2009-04-24T15:52:19.1562500+08:00
this.TextBox20.Text = System.DateTime.Now.ToString("o");
this.TextBox20.Text = System.DateTime.Now.ToString("O");
//2009-04-24T16:30:15
this.TextBox18.Text = System.DateTime.Now.ToString("s");
//2009-04-24 15:52:19
this.TextBox21.Text = System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:ffff");
//2009年04月24 15时56分48秒
this.TextBox22.Text = System.DateTime.Now.ToString("yyyy年MM月dd HH时mm分ss秒");
转自:http://www.cnblogs.com/X-Jonney/archive/2009/07/30/1535047.html
相关文档:
Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols
'若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务,请取消对下行的注释。
<System.Web.Script.Services.ScriptService()> _
<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(Confor ......
在ASP.NET中我们经常需要输出一些JS脚本,比如弹出一个警告窗口,返回到历史页面等JS功能,我看到网上好多这方面的代码,以下代码是其中之一。
整个程序的代码如下:
复制代码 代码如下:
using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.Web.UI;
/// &l ......
private void btnUploadPicture_Click(object sender, System.EventArgs e) { //检查上传文件的格式是否有效 if(this.UploadFile.PostedFile.ContentType.ToLower().IndexOf("image") < 0) { Response.Write("上传图片格式无效!"); return; } //生成原图 Byte[] oFileByte = new byte[this.UploadFile.PostedFile.Conte ......
public string GetPage(int page, int pages, string url)
{
if (pages == 0)
{
&n ......
啟動:Microsoft .NET Framework 2.0 Configuration-->Runtion Security Policy-->右鍵-->Adjust Security-->Make changes to this &nbs ......