ѧϰasp.net C#
1¡¢DateTime Êý×ÖÐÍ
System.DateTime currentTime=new System.DateTime();
¡¡¡¡1.1 È¡µ±Ç°ÄêÔÂÈÕʱ·ÖÃë
currentTime=System.DateTime.Now;
¡¡¡¡1.2 È¡µ±Ç°Äê
int Äê=currentTime.Year;
¡¡¡¡1.3 È¡µ±Ç°ÔÂ
int ÔÂ=currentTime.Month;
¡¡¡¡1.4 È¡µ±Ç°ÈÕ
int ÈÕ=currentTime.Day;
¡¡¡¡1.5 È¡µ±Ç°Ê±
int ʱ=currentTime.Hour;
¡¡¡¡1.6 È¡µ±Ç°·Ö
int ·Ö=currentTime.Minute;
¡¡¡¡1.7 È¡µ±Ç°Ãë
int Ãë=currentTime.Second;
¡¡¡¡1.8 È¡µ±Ç°ºÁÃë
int ºÁÃë=currentTime.Millisecond;
£¨±äÁ¿¿ÉÓÃÖÐÎÄ£©
¡¡¡¡1.9 È¡ÖÐÎÄÈÕÆÚÏÔʾ——ÄêÔÂÈÕʱ·Ö
string strY=currentTime.ToString( "f "); //²»ÏÔʾÃë
¡¡¡¡1.10 È¡ÖÐÎÄÈÕÆÚÏÔʾ_ÄêÔÂ
string strYM=currentTime.ToString( "y ");
¡¡¡¡1.11 È¡ÖÐÎÄÈÕÆÚÏÔʾ_ÔÂÈÕ
string strMD=currentTime.ToString( "m ");
¡¡¡¡1.12 È¡µ±Ç°ÄêÔÂÈÕ£¬¸ñʽΪ£º2003-9-23
string strYMD=currentTime.ToString( "d ");
¡¡¡¡1.13 È¡µ±Ç°Ê±·Ö£¬¸ñʽΪ£º14£º24
string strT=currentTime.ToString( "t ");
¡¡¡¡2¡¢×Ö·ûÐÍת»» תΪ32λÊý×ÖÐÍ
¡¡¡¡Int32.Parse(±äÁ¿) Int32.Parse( "³£Á¿ ")
¡¡¡¡3¡¢ ±äÁ¿.ToString()
¡¡¡¡×Ö·ûÐÍת»» תΪ×Ö·û´®
¡¡¡¡12345.ToString( "n "); //Éú³É 12,345.00
¡¡¡¡12345.ToString( "C "); //Éú³É £¤12,345.00
¡¡¡¡12345.ToString( "e "); //Éú³É 1.234500e+004
¡¡¡¡12345.ToString( "f4 "); //Éú³É 12345.0000
¡¡¡¡12345.ToString( "x "); //Éú³É 3039 (16½øÖÆ)
¡¡¡¡12345.ToString( "p "); //Éú³É 1,234,500.00%
¡¡¡¡4¡¢±äÁ¿.Length Êý×ÖÐÍ
¡¡¡¡È¡×Ö´®³¤¶È
Ïà¹ØÎĵµ£º
ÕâÊÇÒ»¸öÓйطÖÒ³µÄʵÀý,½ö¹©²Î¿¼(´úÂëÀ´×ÔÍøÂç)
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SQLite;
using System.Threading;
using System.Collections;
us ......
public static void Main()
{
WebRequest req = WebRequest.Create("http://blog.csdn.net/xiaofengsheng");
try
& ......
µÚÒ»ÖÖ·½·¨ÊǶÔÒ»¸öaspxÒ³ÃæÉú³ÉhtmlÎļþ£¬ÏȶԷþÎñÆ÷·¢ËÍÇëÇóaspxÒ³Ãæ£¬È¡·þÎñÆ÷·µ»ØµÄhtmlÁ÷£¬Ð´µ½Ò»¸öhtmlÎļþÀaspxÒ³ÃæÏÔʾµÄÊÇʲô£¬Éú³ÉµÄhtmlÒ³Ãæ¾ÍÊÇʲô
£±¡¢asp·½·¨£º
sub createHTML
dim xmlhttp,strhtml,objAdoStream,i,myurl
set xmlhttp=server.CreateObject("Microsoft.XMLHTTP")
&nb ......
ÅäÖÃÎļþ¿ÉÓÃÀ´´æ·ÅһЩ¶à´ÎÓõ½µÄ³£Á¿Êý¾Ý£¬ÈçÁ¬½Ó´®£º
<appSettings>
<add key="connStr1" value="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="/>
<add key="connStr2" value="App_Data\test.mdb"/>
</appSettings>
Õâ¸öÅäÖÃÊý¾Ý¿âÁ¬½Ó´®
ʹÓÃʾÀý£º
public class DBCo ......