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> <p> 本文名称:<a href="http://www.kswsj.com/qtweb/news34/445184.html">5分钟让你了解VB.NET生成静态页面和分页原理</a> <br> URL地址:<a href="http://www.kswsj.com/qtweb/news34/445184.html">http://www.kswsj.com/qtweb/news34/445184.html</a> </p> <p> 网站建设、网络推广公司-成都快上网,一家网站设计、网站制作公司;服务项目有等 </p> <p class="adpic"> <a href="https://www.cdcxhl.com/service/ad.html" target="_blank" class="ad">广告</a> <a href="" target="_blank" class="adimg"><img src=""></a> </p> <p class="copy"> 声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: <a href="http://www.kswsj.com/" target="_blank">成都快上网</a> </p> </div> <div class="newsmorelb"> <p>成都快上网科技猜您喜欢</p> <ul> <li> <a href="/qtweb/news33/445183.html">Android性能优化-OOM崩溃引起的内存管理大爆炸详解</a> </li><li> <a href="/qtweb/news32/445182.html">面向对象的设计模型,数学模型,物理模型</a> </li><li> <a href="/qtweb/news31/445181.html">html如何做左右结构的</a> </li><li> <a href="/qtweb/news30/445180.html">马来西亚中转服务器?(马来西亚中转服务器有哪些)</a> </li><li> <a href="/qtweb/news29/445179.html">管理Linux下PHP目录管理技巧(linuxphp目录)</a> </li><li> <a href="/qtweb/news28/445178.html">主机域名有哪些</a> </li><li> <a href="/qtweb/news27/445177.html">pubg怎么降低俄服延迟?为什么俄罗斯的服务器延时低</a> </li><li> <a href="/qtweb/news26/445176.html">统计MySQL数据总量的方法(mysql数据库查询数据总量)</a> </li><li> <a href="/qtweb/news25/445175.html">基于ngx_lua模块的WAF开发实践</a> </li> </ul> </div> </div> <div class="col-lg-3 noneb"> <div class="bkright" style="margin-top: 0"> <p><a href="https://www.cdcxhl.com/news/sosuo/">搜索引擎优化知识</a></p> <ul> <li> <a class="text_overflow" href="/qtweb/news2/236552.html">dnspod域名解析教程</a> </li><li> <a class="text_overflow" href="/qtweb/news10/206760.html">c语言queue怎么用</a> </li><li> <a class="text_overflow" href="/qtweb/news48/229948.html">如何成功申请顶级域名,打造属于自己的专属品牌</a> </li><li> <a class="text_overflow" href="/qtweb/news25/134275.html">域名续费的流程?(域名过期如何续费)</a> </li><li> <a class="text_overflow" href="/qtweb/news19/48119.html">美国服务器Linux系统常用专业术语有哪些</a> </li><li> <a class="text_overflow" href="/qtweb/news3/499653.html">浙江电信独立服务器百兆?(电信服务器是多少)</a> </li><li> <a class="text_overflow" href="/qtweb/news40/203140.html">轻松筹证实内容怎么写?(麻烦帮忙处理下看什么情况)</a> </li><li> <a class="text_overflow" href="/qtweb/news21/55621.html">标题:解决Linux串口缓存空闲问题(linux串口缓存空)</a> </li><li> <a class="text_overflow" href="/qtweb/news25/354675.html">企业内部邮箱如何设置?(企业内部邮箱如何设置)</a> </li><li> <a class="text_overflow" href="/qtweb/news32/457732.html">如何运行install.php</a> </li><li> <a class="text_overflow" href="/qtweb/news1/436151.html">access报错ole和activex</a> </li><li> <a class="text_overflow" href="/qtweb/news2/232052.html">11个超赞的Vue.js UI组件库</a> </li><li> <a class="text_overflow" href="/qtweb/news37/104787.html">人工智能的优缺点是什么</a> </li><li> <a class="text_overflow" href="/qtweb/news37/195987.html">主机开通下-虚拟主机/数据库问题</a> </li><li> <a class="text_overflow" href="/qtweb/news33/383233.html">原生ip的vps租用有哪些优势和劣势</a> </li> </ul> </div> <div class="bkright tag"> <p><a href="https://www.cdcxhl.com/hangye/" target="_blank">同城分类信息</a></p> <ul> <li class="col-lg-6 col-md-6 col-sm-6 col-xs-6"> <a href="https://www.cdcxhl.com/hangye/hwxxy/" target="_blank">户外休闲椅</a> </li><li class="col-lg-6 col-md-6 col-sm-6 col-xs-6"> <a href="https://www.cdcxhl.com/hangye/weixiufdj/" target="_blank">发电机维修</a> </li><li class="col-lg-6 col-md-6 col-sm-6 col-xs-6"> <a href="https://www.cdcxhl.com/hangye/renzaowu/" target="_blank">人造雾</a> </li><li class="col-lg-6 col-md-6 col-sm-6 col-xs-6"> <a href="https://www.cdcxhl.com/hangye/loutihulan/" target="_blank">楼梯护栏</a> </li><li class="col-lg-6 col-md-6 col-sm-6 col-xs-6"> <a href="https://www.cdcxhl.com/hangye/pvc/" target="_blank">PVC花箱</a> </li><li class="col-lg-6 col-md-6 col-sm-6 col-xs-6"> <a href="https://www.cdcxhl.com/hangye/jiulousj/" target="_blank">酒楼设计</a> </li><li class="col-lg-6 col-md-6 col-sm-6 col-xs-6"> <a href="https://www.cdcxhl.com/hangye/fadianji/" target="_blank">柴油发电机</a> </li><li class="col-lg-6 col-md-6 col-sm-6 col-xs-6"> <a href="https://www.cdcxhl.com/hangye/suliaodai/" target="_blank">塑料袋</a> </li><li class="col-lg-6 col-md-6 col-sm-6 col-xs-6"> <a href="https://www.cdcxhl.com/hangye/zbljbc/" target="_blank">自拌料搅拌车</a> </li><li class="col-lg-6 col-md-6 col-sm-6 col-xs-6"> <a href="https://www.cdcxhl.com/hangye/hldzj/" target="_blank">护栏打桩机</a> </li><li class="col-lg-6 col-md-6 col-sm-6 col-xs-6"> <a href="https://www.cdcxhl.com/hangye/snjbc/" target="_blank">水泥搅拌车</a> </li><li class="col-lg-6 col-md-6 col-sm-6 col-xs-6"> <a href="https://www.cdcxhl.com/hangye/baiwuyu/" target="_blank">白乌鱼</a> </li><li class="col-lg-6 col-md-6 col-sm-6 col-xs-6"> <a href="https://www.cdcxhl.com/hangye/chalousj/" target="_blank">茶楼设计</a> </li><li class="col-lg-6 col-md-6 col-sm-6 col-xs-6"> <a href="https://www.cdcxhl.com/hangye/mbzx/" target="_blank">木包装箱</a> </li><li class="col-lg-6 col-md-6 col-sm-6 col-xs-6"> <a href="https://www.cdcxhl.com/hangye/weilanhulan/" target="_blank">围栏护栏</a> </li><li class="col-lg-6 col-md-6 col-sm-6 col-xs-6"> <a href="https://www.cdcxhl.com/hangye/lajitong/" target="_blank">垃圾桶</a> </li> </ul> </div> </div> </div> <div class="carousel-inner linkbg" style="background: #fff"> <div class="container"> <a href="http://www.htlanyu.com/" target="_blank">营山产后护理</a>    <a href="http://www.cdledzm.com/" target="_blank">成都LED照明</a>    <a href="http://www.fzwuji.cn/" target="_blank">成都婚庆策划</a>    <a href="https://www.cdcxhl.com/wangzhandingzhi.html" target="_blank">成都企业网站定制</a>    <a href="http://www.cdxwcx.cn/bj/" target="_blank">做网站价格</a>    <a href="http://www.cdweb.net/solve/" target="_blank">网站解决方案</a>    <a href="http://seo.cdkjz.cn/tuiguang/" target="_blank">成都网络推广</a>    <a href="http://www.schdas.cn/" target="_blank">四川鸿达</a>    <a href="https://www.cdcxhl.com/service/400.html" target="_blank">400电话申请</a>    <a href="http://www.czyouth.cn/" target="_blank">混凝土搅拌车</a>    <a href="https://www.cdxwcx.com/jifang/yaan.html" target="_blank">川西大数据中心</a>    <a href="http://www.scjzmc.cn/" target="_blank">四川晃众门窗</a>    <a href="http://m.cdcxhl.cn/qiye/ " target="_blank">成都网站建设公司</a>    <a href="https://www.cdxwcx.com/wangzhan/h5.html" target="_blank">响应式网站</a>    <a href="http://www.75091.cn/" target="_blank">德信企业管理</a>    <a href="http://www.scmwjz.com/" target="_blank">网站建设开发</a>    <a href="https://www.cdcxhl.com/qiye.html" target="_blank">企业网站建设</a>    <a href="https://www.cdxwcx.com/tuiguang/zhenghe.html" target="_blank">全网营销</a>    <a href="https://www.cdcxhl.com/jigui/" target="_blank">服务器机柜租用</a>    <a href="http://chengdu.cdcxhl.com/" target="_blank">成都网站设计</a>     </div> </div> <footer> <div class="carousel-inner footjz"> <div class="container"> <i class="icon iconfont zbw"></i> 品质网站建设 <i class="icon iconfont"></i> 多平台展现 <i class="icon iconfont"></i> 600元建站 <i class="icon iconfont"></i> 高效快速 <i class="icon iconfont"></i> 专业用心服务 <button type="button" class="btn btn-default btn-lg" onClick="window.location.href='tencent://message/?uin=631063699&Site=&Menu=yes'"> 立即开始600元网站建设</button> <button type="button" class="btn btn-default btn-xs" onClick="window.location.href='tencent://message/?uin=631063699&Site=&Menu=yes'"> 600元企业网站建设</button> </div> </div> <div class="carousel-inner bqsy"> <div class="container"> <div class="lxfs"> <h4 class="yutelnone">028-86922220 13518219792</h4> <h4 class="yutelblock"><a href="tel:02886922220">028-86922220</a> <a href="tel:13518219792">13518219792</a></h4> <a class="btn btn-default" href="tencent://message/?uin=532337155&Site=&Menu=yes" role="button">网站建设<span>QQ</span>:532337155</a> <a class="btn btn-default" href="tencent://message/?uin=631063699&Site=&Menu=yes" role="button">营销推广<span>QQ</span>:631063699</a> <a class="btn btn1 btn-default" href="mqqwpa://im/chat?chat_type=wpa&uin=532337155&version=1&src_type=web&web_src=oicqzone.com" role="button">网站制作<span>QQ</span>:532337155</a> <a class="btn btn1 btn-default" href="mqqwpa://im/chat?chat_type=wpa&uin=631063699&version=1&src_type=web&web_src=oicqzone.com" role="button">营销推广<span>QQ</span>:631063699</a> <a class="btn btn-default nonea" href="tencent://message/?uin=1683211881&Site=&Menu=yes" role="button">售后QQ:1683211881</a> <div class="dz">成都快上网专注: <a href="http://www.kswsj.com/" target="_blank">成都网站制作</a> <a href="http://www.kswsj.com/" target="_blank">网站设计</a> <a href="http://www.kswsj.com/" target="_blank">成都网站建设</a> <address>地址:成都太升南路288号锦天国际A幢10楼</address> </div> </div> <div class="bzdh dz"><img src="https://www.cdcxhl.com/imges/bottom_logo.png" alt="创新互联"> <p><a href="https://www.cdcxhl.com/menu.html" target="_blank">成都创新互联科技有限公司</a><br> Tel:028-86922220(7x24h)</p></div> </div> </div> </footer> </body> </html> <script> $.getJSON ("../../qtwebpic.txt", function (data) { var jsonContent = { "featured":data } var random = jsonContent.featured[Math.floor(Math.random() * jsonContent.featured.length)]; $(".adpic .adimg").attr("href",random.link) $(".adpic img").attr("src",random.pic); }) </script>