C# »ñÈ¡µ±Ç°ÊÇÐÇÆÚ¼¸µÄÁ½ÖÖ·½·¨
C#µÄ¹¦ÄܺÜÇ¿´ó£¬È´Ã»ÓÐÖ±½ÓÌá¹©ÃæÏòºº×ÖÎÄ»¯µÄ¿ª·¢ÇãÏò
±ÈÈçÎÒÏÖÔÚҪ˵µÄ»ñÈ¡µ±Ç°µÄÐÇÆÚÎÒÌṩÁ½ÖÖ·½·¨£º
¢Ù£¬DateTime.Now.DayOfWeek £¬²éѯMSDN¿ÉÒÔÖªµÀ¸ÃÊôÐÔ·µ»ØµÄ½á¹ûÊÇ£º
//
// ÕªÒª:
// »ñÈ¡´ËʵÀýËù±íʾµÄÈÕÆÚÊÇÐÇÆÚ¼¸¡£
//
// ·µ»Ø½á¹û:
// Ò»¸ö System.DayOfWeek ö¾Ù³£Êý£¬ËüָʾÐÇÆÚ¼¸¡£¸ÃÊôÐÔÖµµÄ·¶Î§´ÓÁ㣨±íʾÐÇÆÚÈÕ£©µ½Áù£¨±íʾÐÇÆÚÁù£©¡£
public DayOfWeek DayOfWeek
{
get;
}
ÒÀ¾ÝÕâ¸öÎÒÃÇÏë¼û¸ÃÊôÐÔÌṩÁË´ÓÐÇÆÚÈÕµ½ÐÇÆÚÁùµÄλÖã¬Ò²¾ÍÊÇ˵ÊÇö¾Ù£¬Ã¶¾Ù½áºÏÊý×é²»¾Í¿ÉÒÔÌáÈ¡ÎÒÃÇÏëÒªµÄÊý¾ÝÁËÂ𣡴úÂëÈçÏ£º
public string Week()
{
string[] weekdays ={ "ÐÇÆÚÈÕ" ,"ÐÇÆÚÒ»" ,"ÐÇÆÚ¶þ" ,"ÐÇÆÚÈý" ,"ÐÇÆÚËÄ" ,"ÐÇÆÚÎå" ,"ÐÇÆÚÁù" };
string week=weekdays[Convert.ToInt32(DateTime.Now.DayOfWeek)];
return week;
}
ÄãÖ»Òªµ÷Óø÷½·¨£ºWeek()¾Í¿ÉÒԵõ½µ±Ç°ÐÇÆÚ¼¸µÄºº×Ö±íʾ Lable1.Text=Week();
¢ÚµÚ¶þÖÖ·½·¨ÊÇÖ±½Ó¸ù¾ÝÐÇÆÚµÄÊýÄ¿±È½ÏС»¹¿ÉÒÔÖ±½Óת»¯£¬ÕâʱºòÎÒÃÇ¿ÉÒÔÓÃswitch¹Ø¼ü×Ö´úÂëÈçÏ£º
public string Week(string weekName)
{
string week;
switch(weekName)
{
Ïà¹ØÎĵµ£º
1.Response.Redirect("http://www.jb51.net",false);
Ä¿±êÒ³ÃæºÍÔÒ³Ãæ¿ÉÒÔÔÚ2¸ö·þÎñÆ÷ÉÏ£¬¿ÉÊäÈëÍøÖ·»òÏà¶Ô·¾¶¡£ºóÃæµÄboolֵΪÊÇ·ñÍ£Ö¹Ö´Ðе±Ç°Ò³¡£
Ìø×ªÏòеÄÒ³Ãæ£¬Ô´°¿Ú±»´úÌæ¡£"
ä¯ÀÀÆ÷ÖеÄURLΪз¾¶¡£
:Response.Redirect·½·¨µ¼ÖÂä¯ÀÀÆ÷Á´½Óµ½Ò»¸öÖ¸¶¨µÄURL¡£µ±Response.Redirect()·½·¨± ......
дcookie
¡¡¡¡1 HttpCookie cookie = new HttpCookie("Info");//¶¨Òåcookie¶ÔÏóÒÔ¼°ÃûΪInfoµÄÏî
¡¡¡¡2 DateTime dt = DateTime.Now;//¶¨Òåʱ¼ä¶ÔÏó
¡¡¡¡3 TimeSpan ts=new TimeSpan(1,0,0,0);//cookieÓÐЧ×÷ÓÃʱ¼ä£¬¾ßÌå²émsdn
¡¡¡¡4 cookie.Expires = dt.Add(ts);//Ìí¼Ó×÷ÓÃʱ¼ä
¡¡¡¡5 cookie.Values.Add("user","cx ......
Paging long articles in ASP.NET using C#
Long articles are better broken into bite-sized chunks over several pages. With static HTML, this is easily achieved by dividing the article into logical separations and creating separate .htm files for each. Here's how to do it using C# for an article that ......
using System;
using System.Data;
using System.Configuration;
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 Microsoft.Office.Inter ......
using System;
using System.IO;
using System.Windows.Forms;
using Access = Microsoft.Office.Interop.Access;
// Ìí¼ÓÒýÓÃ->.NET-> dao£¬Microsoft.Office.Interop.Access
namespace WinFormAccess
{
public partial class FormAccess : Form
{
&nbs ......