|
Server : Microsoft-IIS/10.0 System : Windows NT EBS-6136 10.0 build 17763 (Windows Server 2016) i586 User : jxgj ( 0) PHP Version : 7.0.33 Disable Function : passthru,exec,system,shell_exec,proc_open,popen,pcntl_exec,socket_bind,stream_socket_server Directory : D:/tmp_aspnet/root/cae6aa2e/15328683/ |
?#pragma checksum "D:\wwwroot\anlian2025\wwwroot\App_Code\GetPageMobile.cs" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "68FC56FD524A4D9AF0A5BE6BD12ADA1DFB1B9011"
#line 1 "D:\wwwroot\anlian2025\wwwroot\App_Code\GetPageMobile.cs"
using System;
using System.Collections.Generic;
using System.Web;
using System.Text;
using System.Text.RegularExpressions;
namespace Basic.Engine.Get
{
/// <summary>
/// 获取分页代码
/// </summary>
public static class PagiNation_Mobile
{
/// <summary>
/// 获取分页代码(总页数,当前页)手机端
/// </summary>
/// <param name="TotelPage"></param>
/// <param name="NowPage"></param>
public static string GetPageHtml(int TotelPage, int NowPage)
{
string NowUrl = HttpContext.Current.Request.RawUrl;
Regex Rzz = new Regex(@"\?page=\d+|\&page=\d+", RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.IgnorePatternWhitespace);
NowUrl = Rzz.Replace(NowUrl, "", 1);
if (NowUrl.ToLower().Contains("?"))
{
NowUrl = NowUrl + "&page=";
}
else
{
NowUrl = NowUrl + "?page=";
}
int prevPage = NowPage - 1;
int nextPage = NowPage + 1;
StringBuilder strFenye = new StringBuilder();
if (TotelPage > 1)
{
strFenye.Append("<div id=\"PageContent\" class=\"flickr\" style=\"text-align: center;\">");
strFenye.Append("<div class=\"pages\">");
strFenye.Append("<span><a>" + NowPage + "/" + TotelPage + "</a></span>");
strFenye.Append("<span><a href=\"" + NowUrl + "1\">首页</a></span>");
if (NowPage == 1)
{
strFenye.Append("<span><a href=\"#\">上一页</a></span>");
}
else
{
strFenye.Append("<span><a href=\"" + NowUrl + prevPage + "\">上一页</a></span>");
}
if (NowPage == TotelPage)
{
strFenye.Append("<span><a href=\"#\">下一页</a></span>");
}
else
{
strFenye.Append("<span><a href=\"" + NowUrl + nextPage + "\">下一页</a></span>");
}
strFenye.Append("<span><a href=\"" + NowUrl + TotelPage + "\">末页</a></span>");
strFenye.Append("</div>");
strFenye.Append("</div>");
}
return strFenye.ToString();
}
}
}
#line default
#line hidden