成都网站建设设计

将想法与焦点和您一起共享

5分钟让你了解VB.NET生成静态页面和分页原理

程序员有的时候为一些小的问题而烦恼,在这里帮大家解决一个关于VB.NET生成静态页面和分页原理的分析,下面就来看代码:

1、VB.NET生成静态页面和分页原理静态页面template.html,主要是定义了一些特殊字符,用来被替换。

 
 
 
  1.  
  2.  
  3.  
  4. $Title title> </li> <li> head> </li> <li><body> </li> <li><div style="width: 417px; height: 54px" align="center"> </li> <li><br /> </li> <li>$Title div> </li> <li><div style="width: 417px; height: 8px"> </li> <li>浏览<font color="red"><script src="http://localhost/.Net/NewsFiles/ClickCount.aspx?NewsId=$NewsId"> script> font>次  $Time div> </li> <li><div style="width: 417px; height: 100px"> </li> <li>$Content div> </li> <li><div style="width: 416px; height: 9px"> </li> <li>$Pager div> </li> <li><div style="width: 416px; height: 8px"> </li> <li><form id="form1" action="../AddComment.aspx" style="margin:0px"> </li> <li><input id="Text1" type="text" /><Img id="Image1" src="../../UserInfo/CheckCode.aspx"/><br /> </li> <li><textarea  id="CommentContent" cols="20" rows="2"> textarea> </li> <li><br /> </li> <li><input id="NewsId" type="hidden" value="$NewsId"/> </li> <li><input id="Button1" type="submit" value="button" /> </li> <li><a href="../Display.aspx?NewsId=$NewsId">查看更多评论 a> form> </li> <li> div> </li> <li> body> </li> <li> html> </li> </ol></pre><p><strong>2、VB.NET生成静态页面和分页原理分析前态页面 NewsAdd.aspx,就是一个表单,用来填写新闻的标题和内容。</strong></p><pre> <ol> <li><strong><</strong>%...@ Page Language="C#" AutoEventWireup="false" validateRequest="false" CodeFile="NewsAdd.aspx.cs" Inherits="NewsAdd.Admin_AdminPanel_NewsAdd" %<strong>></strong> </li> <li><strong><</strong>%...@ Register TagPrefix="FCKeditorV2" Namespace="FredCK.FCKeditorV2" Assembly="FredCK.FCKeditorV2" %<strong>></strong> </li> <li><strong>></strong> </li> <li><strong><html</strong> xmlns="http://www.w3.org/1999/xhtml" <strong>></strong> </li> <li><strong><head</strong> runat="server"<strong>></strong> </li> <li><strong><title></strong>添加新闻<strong> title></strong> </li> <li><strong> head></strong> </li> <li><strong><body></strong> </li> <li><strong><form</strong> id="form1" runat="server"<strong>></strong> </li> <li><strong><div></strong> </li> <li><strong><asp:Label</strong> ID="Label2" runat="server" Text="标题"<strong>> asp:Label></strong> </li> <li><strong><asp:TextBox</strong> ID="Title" runat="server" Width="325px"<strong>> asp:TextBox><br</strong> <strong>/></strong> </li> <li><strong><asp:Label</strong> ID="Label1" runat="server" Text="内容"<strong>> asp:Label></strong> </li> <li><strong><FCKeditorV2:FCKeditor</strong> id="Content" basePath="~/FCKeditor/"  runat="server" Height="400px" Width="70%"<strong>> FCKeditorV2:FCKeditor></strong> </li> <li><strong><asp:Button</strong> ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" <strong>/></strong> </li> <li><strong><asp:Label</strong> ID="Message" runat="server" <strong>> asp:Label> div></strong> </li> <li><strong> form></strong> </li> <li><strong> body></strong> </li> <li><strong> html></strong> </li> </ol></pre><p><strong>3、VB.NET生成静态页面和分页原理后台页面 NewsAdd.aspx.cs</strong></p><pre> <ol> <li>using System;  </li> <li>using System.Data;  </li> <li>using System.Configuration;  </li> <li>using System.Collections;  </li> <li>using System.Web;  </li> <li>using System.Web.Security;  </li> <li>using System.Web.UI;  </li> <li>using System.Web.UI.WebControls;  </li> <li>using System.Web.UI.WebControls.WebParts;  </li> <li>using System.Web.UI.HtmlControls;  </li> <li>using Mysqlserver;  </li> <li>using System.IO;  </li> <li>using System.Text;  </li> <li>namespace NewsAdd  </li> <li>...{  </li> <li>public partial class Admin_AdminPanel_NewsAdd : System.Web.UI.Page  </li> <li>...{  </li> <li>protected void Page_Load(object sender, EventArgs e)  </li> <li>...{  </li> <li>}  </li> <li>protected void Button1_Click(object sender, EventArgs e)  </li> <li>...{  </li> <li>string strDate = DateTime.Now.ToString("yyMMdd") + "\" + DateTime.Now.ToString("yyyymmddhhmmss");  </li> <li>string strFileName = strDate + ".shtml";//存储到数据库中  </li> <li>string strTitle=Request.Form["Title"].ToString().Trim();//接收传过来的标题  </li> <li>string strContent=Request.Form["Content"].ToString().Trim();//接收传过来的内容  </li> <li>string[] content = strContent.Split(new Char[] ...{'|'});//对内容进行拆分,并保存到数组  </li> <li>int upbound = content.Length;//数组的上限  </li> <li>SqlServerDataBase db = new SqlServerDataBase();  </li> <li>bool success = db.Insert("insert into inNews(Title,Content,FilePath)values('" + strTitle + "','" + strContent + "','" + strFileName + "')", null);  </li> <li>//if (success)  </li> <li>   // Message.Text = "添加成功!";  </li> <li>/**////////////////////////////创建当前日期的文件夹开始  </li> <li>string dir = Server.MapPath("../../"+"NewsFiles/"+DateTime.Now.ToString("yyMMdd"));//用来生成文件夹  </li> <li>if (!Directory.Exists(dir))  </li> <li>...{  </li> <li>Directory.CreateDirectory(dir);  </li> <li>} </li> </ol></pre><p>【编辑推荐】</p><ol><li>VB.NET获取硬盘信息四大法宝</li><li>讲述VB.NET调用Excel的好处</li><li>简单例子概述VB.NET新窗体</li><li>描述VB.NET工程转换成步骤</li><li>自己动手实现VB.NET控件数组</li></ol> <br> 标题名称:5分钟让你了解VB.NET生成静态页面和分页原理 <br> 文章网址:<a href="https://chengdu.cdxwcx.cn/article/djoohgj.html">https://chengdu.cdxwcx.cn/article/djoohgj.html</a> </div> </div> </div> <!--左边end--> <!--右边begin--> <div class="news_r"> <div class="news_t"><h2 class="h2">其他资讯</h2></div> <div class="news_ul3"> <ul> <li> <a href="/article/djoheig.html"> <h3 class="h3">高防服务器海外</h3> </a> </li><li> <a href="/article/djoheij.html"> <h3 class="h3">域名的实名制审核是在哪里去审的?(此域名帮我重新提交审核)</h3> </a> </li><li> <a href="/article/djohedp.html"> <h3 class="h3">手边的Tunnel知多少</h3> </a> </li><li> <a href="/article/djohejo.html"> <h3 class="h3">windows限免?(windows限免)</h3> </a> </li><li> <a href="/article/djohejd.html"> <h3 class="h3">怎么仿站,到北京怎么上仿</h3> </a> </li> </ul> </div> </div> <!--右边end--> <div class="c_l"></div> </div> </div> <!--正文end--> <!--尾部begin--> <!--尾部begin--> <footer> <div class="f_bg"> <div class="wrap"> <div class="links"> <h2 class="h2">甜橘子解决方案<a href="/solution/" title="更多" class="more">更多+</a></h2> <ul> <li><a href="/solution/xiaochengxu.html" title="小程序定制解决方案">小程序定制解决方案</a></li> <li><a href="/solution/qiyewz.html" title="企业网站建设解决方案">企业网站建设解决方案</a></li> <li><a href="/solution/menhuwz.html" title="行业门户网站建设解决方案">行业门户网站建设解决方案</a></li> <li><a href="/solution/yingxiaowz.html" title="营销型网站建设解决方案">营销型网站建设解决方案</a></li> <li><a href="/solution/waimaowz.html" title="外贸网站建设解决方案">外贸网站建设解决方案</a></li> <li><a href="/solution/pingpaiwz.html" title="品牌形象网站建设解决方案">品牌形象网站建设解决方案</a></li> <li><a href="/solution/dianziwz.html" title="数码、电子产品网站建设解决方案">数码、电子产品网站建设解决方案</a></li> <li><a href="/solution/jituanwz.html" title="集团、上市企业网站建设解决方案">集团、上市企业网站建设解决方案</a></li> <li><a href="/solution/dichanwz.html" title="房地产、地产项目网站建设解决方案">房地产、地产项目网站建设解决方案</a></li> <li><a href="/solution/zhubaowz.html" title="珠宝高端奢侈品网站建设解决方案">珠宝高端奢侈品网站建设解决方案</a></li> </ul> </div> <div class="links w2"> <h2 class="h2">我们的实力<a href="/about/" title="更多" class="more">更多+</a></h2> <ul> <li>10年专业互联网服务经验</li> <li>成都高端建站设计团队</li> <li>资深行业分析策划</li> <li>B2C营销型网站建设者</li> <li>前沿视觉设计、研发能力</li> <li>前端代码深度符合SEO优化</li> <li>成都市高新技术企业证书</li> <li>具有完备的项目管理</li> <li>完善的售后服务体系</li> <li>深厚的网络运营经验</li> <li>时刻新技术研发能力</li> <li>16个网站系统软件著作权</li> </ul> </div> <div class="f_div2_r"> <h2 class="h2">关于甜橘子<a href="/about/" title="更多" class="more">更多+</a></h2> 甜橘子网站设计,为客户量身定制各类网站建设业务,包括企业型、电子商务型、行业门户型、品牌建立型等各类网站,实战经验丰富,成功案例众多。以客户利益为出发点,甜橘子网站制作为客户规划、定制符合企业需求、带有营销价值的建站方案,提供从网站前期定位分析策划到网站界面设计... </div> <div class="c_l"></div> </div> <div class="wrap"> <div class="f_div3"> <span class="l">成都网站制作案例©2020 甜橘子设计 版权所有 | <a href="http://chengdu.cdxwcx.cn" target="_blank">甜橘子网站设计</a><a href="http://chengdu.cdxwcx.cn" target="_blank">chengdu.cdxwcx.cn</a></span> <span class="r"><a href="https://beian.miit.gov.cn/" target="_blank" rel="nofollow">蜀ICP备11025516号</a></span> </div> </div> </div> </footer> <!--尾部end--> <script language="javascript" src="/Public/Home/js/foot.js"></script> <!--尾部end--> <!--侧边栏begin--> <div class="side"> <ul> <li id="qqonline_xbceo"><a href="tencent://message/?uin=631063699&Site=&Menu=yes"><i class="bgs1"></i>QQ咨询</a></li> <li class="shangqiao"><a href="tencent://message/?uin=532337155&Site=&Menu=yes" title="在线咨询"> <div><i class="bgs2"></i>在线咨询</div> </a></li> <li class="sideewm"><i class="bgs3"></i>官方微信 <div class="ewBox"></div> </li> <li class="sideetel"><i class="bgs4"></i>联系电话 <div class="telBox"> <dd class="bgs1"><span>座机</span><a href="tel:028-86922220" target="_blank">028-86922220</a></dd> <dd class="bgs2"><span>手机</span><a href="tel:13518219792" target="_blank">13518219792</a></dd> </div> </li> <li class="sidetop" onClick="goTop()" id="sidetop"><i class="bgs6"></i>返回顶部</li> </ul> </div> <script type="text/javascript"> $('.sideewm').hover(function(){ $('.ewBox').stop().fadeIn(); },function(){ $('.ewBox').stop().fadeOut(); }); $('.sideetel').hover(function(){ $('.telBox').stop().fadeIn(); },function(){ $('.telBox').stop().fadeOut(); }); $(".con_id img").each(function(){ var src = $(this).attr("src"); //获取图片地址 var str=new RegExp("http"); var result=str.test(src); if(result==false){ var url = "https://www.cdcxhl.com"+src; //绝对路径 $(this).attr("src",url); } }); </script> <!-- WPA start --> <!-- WPA end --> <!--侧边栏end--> </body> </html>