Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Paging long articles in ASP.NET using C#

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 gets posted to a database.
The Regular Expression Split() method returns a one-dimensional zero-based array containing a number of substrings, so it is perfect for this job. What I want to do is take an article (which is a string) and divide it into substrings. In order to do this, I need a delimiter, and I use <!--pagebreak-->. As I enter the article into the database, I place <!--pagebreak--> at the points I want to break the article.
Then, having extracted the article from the database, I pass it to the following static method which I have in a utility class:
public static string PageArticle(string Article)
{
string Output;
string ThisPage = HttpContext.Current.Request.ServerVariables["SCRIPT_NAME"];

string PageNo;
PageNo = HttpContext.Current.Request.QueryString["Page"];
if (Article.IndexOf("<!--pagebreak-->") != -1)
{
string[] Pages = Regex.Split(Article, "<!--pagebreak-->");
int TotalPages = Pages.GetUpperBound(0) + 1;
int Counter = 1;
int PageNumber = 1;
if (PageNo != null)
{
PageNumber = System.Convert.ToInt32(PageNo);
}
Output = Pages[PageNumber - 1];
Output += "<p>Go to Page ";
while (Counter <= TotalPages)
{
if (Counter == PageNumber)
{
Output += Counter.ToString() + " ";
}
else
{
Output += "<a href="\" mce_href="\""" + ThisPage + "?Page=" + Counter.ToString();
Output += "\">" + Counter.ToString() + "</a> ";
}
Counter++;
}
Output += "</p>";
}
else
{
Output = Article;
}
re


Ïà¹ØÎĵµ£º

C#£¨ASP.NET£© ÏÂÔØÊý¾Ý

Internet Àà
using System;
using System.Collections.Generic;
using System.Collections;
using System.Text;
using System.Net;
using System.IO;
using System.Text.RegularExpressions;
using System.Threading;
namespace DownData
{
    class internet
    {
 &nb ......

asp.net(c#)ÍøÒ³ÌøתÆßÖÖ·½·¨

1.Response.Redirect("http://www.jb51.net",false);
Ä¿±êÒ³ÃæºÍÔ­Ò³Ãæ¿ÉÒÔÔÚ2¸ö·þÎñÆ÷ÉÏ£¬¿ÉÊäÈëÍøÖ·»òÏà¶Ô·¾¶¡£ºóÃæµÄboolֵΪÊÇ·ñÍ£Ö¹Ö´Ðе±Ç°Ò³¡£
ÌøתÏòеÄÒ³Ã棬ԭ´°¿Ú±»´úÌæ¡£"
ä¯ÀÀÆ÷ÖеÄURLΪз¾¶¡£
:Response.Redirect·½·¨µ¼ÖÂä¯ÀÀÆ÷Á´½Óµ½Ò»¸öÖ¸¶¨µÄURL¡£µ±Response.Redirect()·½·¨± ......

ASP.NET MVC ϵÁÐÎÄÕÂ

http://www.cnblogs.com/chsword/archive/2008/03/10/dotnetmvcframework.html
ÒÔÏÂÎÄÕÂÊôÓÚASP.NET MVC 1.0 Õýʽ°æ
ASP.NET MVCµñ³æС¼¼ 1-2
ASP.NET MVC Öصã½Ì³ÌÒ»ÖÜÄê°æ µÚʮһ»Ø ĸ°æÒ³¡¢Óû§×Ô¶¨Òå¿Ø¼þ¼°ÎļþÉÏ´«
ASP.NET MVC Öصã½Ì³ÌÒ»ÖÜÄê°æ µÚÊ®»Ø ÇëÇóController
ASP.NET MVC Öصã½Ì³ÌÒ»ÖÜÄê°æ µÚ¾Å»Ø H ......

ÈçºÎʵÏÖAsp.Net¿Ø¼þµÄË«»÷ʼþ

 Asp.net¿Ø¼þ£¨°üÀ¨Web·þÎñÆ÷¿Ø¼þºÍHtml·þÎñÆ÷¿Ø¼þ£©¶¼Ã»ÓÐË«»÷ʼþ£¬ÄÇô¸ÃÈçºÎ½«Ë«»÷ʼþ¸¶¸øAsp.Net¿Ø¼þÄØ£¿ÎÒÃÇÒÔLable¿Ø¼þΪÀý¡£
      
        Ò»¡¢Ê×ÏȼÓÈë¿Ø¼þ£¬IDΪLable1£¬È»ºó¼ÓÈëÒ»¸öButton¿Ø¼þ£¬IDΪButton1£¬´úÂëÈçÏÂ
 
& ......

¹ØÓÚASP.NET/C#ÖжÔCookieµÄ²Ù×÷

д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 ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ