网站建设资讯

NEWS

网站建设资讯

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://xinyudec.cn/article/djoohgj.html">https://xinyudec.cn/article/djoohgj.html</a> </div> </div> <div class="other"> <h3>其他资讯</h3> <ul> <li> <a href="/article/cjposg.html">出租车行业能否“起死回生”?</a> </li><li> <a href="/article/chggid.html">国际顶级域名有哪些企业网站的域名价格是多少</a> </li><li> <a href="/article/jojpho.html">golang如何判断字符串是否以指定字符开头</a> </li><li> <a href="/article/jdecjp.html">mysql怎么添加用户并授权</a> </li><li> <a href="/article/jhcips.html">能让你成为更优秀程序员的10个C语言资源分别是什么</a> </li><li> <a href="/article/dddcsce.html">wordpress在线课 wordpress在线教育</a> </li><li> <a href="/article/dsgjieh.html">nosql毕业设计,nosql数据库设计</a> </li><li> <a href="/article/discdeg.html">mysql怎么构造命令 mysql怎么造数据</a> </li><li> <a href="/article/dhcgssg.html">红色血河Redis血崩穿透击穿(redis血崩穿透击穿)</a> </li><li> <a href="/article/cogpddg.html">怎么在万网注册域名?(如何万网注册域名)</a> </li> </ul> </div> </div> </div> <footer> <div class="footop"> <div class="wrap"> <div class="bottomrpw"> <div class="erp arp"> <dl> <dt>ADDRESS</dt> <dd class="address"> <i class="icon"></i> <span class="word">成都市青羊区锦天国际1号楼1002室</span> </dd> </dl> </div> <div class="erp arp"> <dl> <dt>TEL</dt> <dd class="phonum"> <i class="icon"></i> <span class="word en"> <a href="tel:18980820575">18980820575</a> </span> </dd> </dl> </div> <div class="erp crp"> <dl> <dt>OTHER</dt> <dd> <a class="word get-quote" href="http://www.cdkjz.cn/fangan/">获得报价与方案</a> </dd> <dd> <a href="https://www.cdxwcx.com/pay/" target="_blank" class="word" title="付款方式">付款方式</a> </dd> </dl> </div> <div class="erp code-rp"> <dl> <dt>Wechat</dt> <dd class="code-wrap"> <span class="code"> <img src="/Public/Home/images/qr-code.jpg" alt="新宇德琛微信公众号" /> </span> </dd> </dl> </div> </div> </div> </div> <div class="footerbot"> <div class="friendlinks"> <div class="wrap"> <ul class="rpl"> <li><a href="http://www.xyehang.com/" title="官渡五金" target="_blank">官渡五金</a></li><li><a href="http://www.kmqmu.com/" title="云南保山做网站" target="_blank">云南保山做网站</a></li><li><a href="http://www.sxsrfx.com/" title="成都商标专利" target="_blank">成都商标专利</a></li><li><a href="http://www.cdxiangsuban.com/" title="成都橡塑板销售" target="_blank">成都橡塑板销售</a></li><li><a href="https://www.cdcxhl.com/zuo/chengdu.html" title="四川成都做网站" target="_blank">四川成都做网站</a></li><li><a href="http://www.whqgszc.com/" title="武侯区工商注册" target="_blank">武侯区工商注册</a></li><li><a href="http://www.cdwxfdj.com/" title="成都维修发电机公司" target="_blank">成都维修发电机公司</a></li><li><a href="http://www.hgkttd.com/" title="昆明办公家具" target="_blank">昆明办公家具</a></li><li><a href="http://www.qkjzk.com/" title="资阳发电机维修" target="_blank">资阳发电机维修</a></li><li><a href="http://www.cxhljz.cn/solution/" title="培训网站方案" target="_blank">培训网站方案</a></li> </ul> </div> </div> <div class="wrap"> <div class="copyright"> <span class="en">©2007-2026</span> 成都新宇德琛机电有限公司 <span class="en">ALL RIGHTS RESERVED.</span> <a rel="nofollow" href="https://beian.miit.gov.cn/" target="_blank">蜀ICP备2025128472号</a> </div> </div> </div> </footer> <div class="fcwrap"> <ul class="rpl clearfix"> <li class="phone"> <a rel="nofollow" target="_blank" href="tel:18980820575"> <i class="icon"></i> <strong>18980820575</strong> </a> </li> <li class="qq"> <a rel="nofollow" target="_blank" href="https://wpa.qq.com/msgrd?v=1&uin=244261566&site=qq&menu=yes"> <i class="icon"></i> <strong>244261566</strong> </a> </li> <li class="back-top"> <a href="javascript:void(0)" rel="nofollow" class="back-to-top"> <i class="icon"></i> <strong>回到顶部</strong> </a> </li> </ul> </div> <!--nav--> <div class="n-Wrap"> <div class="navBar visble show"> <div class="barlogo"> <a href="/" rel="nofollow"> <img src="/Public/Home/images/logo1.png" alt="成都做网站" /> <img src="/Public/Home/images/logo2.png" alt="成都网站设计" /> </a> </div> <div class="bmenu"> <i class="bar-top"><span></span></i> <i class="bar-cen"><span></span></i> <i class="bar-bom"><span></span></i> <i class="bar-left"><span></span></i> <i class="bar-right"><span></span></i> </div> </div> <section class="fixmenu"> <div class="close-bar"> <i class="bar-left"><span></span></i> <i class="bar-right"><span></span></i> </div> <nav class="smph"> <ul> <li class="index-hrefs on"><a href="http://www.xinyudec.cn/" title="网站首页"><font>首页</font></a></li> <li><a href="/about/" rel="nofollow"><font>关于我们</font></a></li> <li><a href="/service/" rel="nofollow"><font>网站建设</font></a></li> <li><a href="/case/" rel="nofollow"><font>网站案例</font></a></li> <li><a href="/solve/" rel="nofollow"><font>网站方案</font></a></li> <li><a href="/news/" rel="nofollow"><font>建站知识</font></a></li> <li><a href="/contact/" rel="nofollow"><font>联系新宇德琛</font></a></li> </ul> <div class="pwrap"> <span class="label">建站热线</span> <strong class="phone"><a href="tel:18980820575">18980820575</a></strong> </div> </nav> </section> </div> <!--end nav--> <script src="/Public/Home/js/hotcss.js"></script> <script type="text/javascript" src="/Public/Home/js/su_new.js"></script> </body> </html> <script> $(".con 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); } }); window.onload=function(){ document.oncontextmenu=function(){ return false; } } </script>