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.shufengxianlan.com/qtweb/news34/445184.html">5分钟让你了解VB.NET生成静态页面和分页原理</a> <br> 文章转载:<a href="http://www.shufengxianlan.com/qtweb/news34/445184.html">http://www.shufengxianlan.com/qtweb/news34/445184.html</a> </p> <p> 网站建设、网络推广公司-创新互联,是专注品牌与效果的网站制作,网络营销seo公司;服务项目有等 </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="https://www.cdcxhl.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/cloud/">云服务器知识</a></p> <ul> <li> <a class="text_overflow" href="/qtweb/news37/155337.html">备案号被阻止-备案平台</a> </li><li> <a class="text_overflow" href="/qtweb/news42/246842.html">你们有了解网站不收录的原因都是什么吗?(坏链怎么影响网站排名,什么是坏链)</a> </li><li> <a class="text_overflow" href="/qtweb/news32/331682.html">乌克兰新闻机构遭俄军事黑客组织攻击</a> </li><li> <a class="text_overflow" href="/qtweb/news28/277628.html">聊聊对Nacos Client服务发现源码分析</a> </li><li> <a class="text_overflow" href="/qtweb/news11/232211.html">4G设备接收数据库的方法及注意事项(4g设备怎样接收数据库)</a> </li><li> <a class="text_overflow" href="/qtweb/news34/110184.html">想租用一台服务器做游戏,应该选择什么样的服务器呢?租一个手游服务器</a> </li><li> <a class="text_overflow" href="/qtweb/news4/281354.html">MicrosoftOrca-213B小语言模型击败70B替代品</a> </li><li> <a class="text_overflow" href="/qtweb/news17/484367.html">存储系统发展_配置底层存储系统</a> </li><li> <a class="text_overflow" href="/qtweb/news37/510537.html">网通服务器在哪</a> </li><li> <a class="text_overflow" href="/qtweb/news16/200616.html">高防服务器怎样分辨真伪视频</a> </li><li> <a class="text_overflow" href="/qtweb/news49/392849.html">内存怎么看频率</a> </li><li> <a class="text_overflow" href="/qtweb/news29/2429.html">阿里企业邮箱功能</a> </li><li> <a class="text_overflow" href="/qtweb/news9/123159.html">redis如何处理并发访问的问题</a> </li><li> <a class="text_overflow" href="/qtweb/news35/380985.html">苏州网站建设推广专家推荐</a> </li><li> <a class="text_overflow" href="/qtweb/news14/371064.html">280字编程挑战:把一条推特长度的代码玩出花</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/jiaquan/" 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/zhendongpan/" 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/ruanzhuangsj/" 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/geshan/" 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/shipenji/" 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/shidiao/" 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/yangtaihulan/" 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/bdfhw/" 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><li class="col-lg-6 col-md-6 col-sm-6 col-xs-6"> <a href="https://www.cdcxhl.com/hangye/xiangsu/" 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/sqwhq/" 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/zkj/" 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/chunshuiji/" 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/jbgc/" 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/putaojia/" target="_blank">葡萄架</a> </li> </ul> </div> </div> </div> <div class="carousel-inner linkbg" style="background: #fff"> <div class="container"> <a href="https://www.cdcxhl.cn/ " target="_blank">云服务器香港</a>    <a href="http://www.sczjjy.com/" target="_blank">四川中建建业</a>    <a href="http://www.cxjianzhan.com/custom/" target="_blank">建站定制开发</a>    <a href="http://chengdu.cdcxhl.cn/H5/ " target="_blank">成都响应式网站建设</a>    <a href="http://chengdu.cdcxhl.cn/wechat/ " target="_blank">成都微信小程序开发</a>    <a href="http://www.idckuai.cn/" target="_blank">云服务器</a>    <a href="http://www.wjwzjz.com/" target="_blank">温江做网站</a>    <a href="http://www.cqcxhl.com/service/education.html" target="_blank">重庆教育培训网站建设</a>    <a href="https://www.cdxwcx.com/jifang/deyang.html" target="_blank">德阳机房</a>    <a href="http://chengdu.cdcxhl.com/" target="_blank">营销型网站建设</a>    <a href="http://www.cdhuace.com/" target="_blank">户外广告设计</a>    <a href="http://chengdu.cdxwcx.cn/" target="_blank">成都网站建设</a>    <a href="http://m.cdcxhl.cn/qiye/ " target="_blank">企业网站建设</a>    <a href="https://www.cdxwcx.com/city/jiangyou/" target="_blank">江油网站建设</a>    <a href="http://chengdu.cdcxhl.cn/ " target="_blank">成都网站设计</a>    <a href="http://www.cdhuace.com/faguangzi/bfg.html" target="_blank">led背发光字</a>    <a href="https://www.djxuejia.com/brand-1.html" target="_blank">雪茄烟品牌</a>    <a href="http://www.4006tel.net/yingxiao/" target="_blank">seo优化</a>    <a href="http://m.cdcxhl.cn/seo/ " target="_blank">成都网站优化</a>    <a href="https://www.cdcxhl.com/security/" 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> 节约开发成本 <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'"> 立即开始2800定制网站建设</button> <button type="button" class="btn btn-default btn-xs" onClick="window.location.href='tencent://message/?uin=631063699&Site=&Menu=yes'"> 2800定制网站建设</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="https://www.cdcxhl.com/" target="_blank">网站设计</a> <a href="https://www.cdcxhl.com/" target="_blank">网站制作</a> <a href="https://www.cdcxhl.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:400-028-6601(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>