您好,登錄后才能下訂單哦!
這篇文章主要為大家展示了“VB.NET如何生成靜態(tài)頁(yè)面和分頁(yè)原理”,內(nèi)容簡(jiǎn)而易懂,條理清晰,希望能夠幫助大家解決疑惑,下面讓小編帶領(lǐng)大家一起研究并學(xué)習(xí)一下“VB.NET如何生成靜態(tài)頁(yè)面和分頁(yè)原理”這篇文章吧。
1、VB.NET生成靜態(tài)頁(yè)面和分頁(yè)原理靜態(tài)頁(yè)面template.html,主要是定義了一些特殊字符,用來(lái)被替換。
> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>$Titletitle> head> <body> <div style="width: 417px; height: 54px" align="center"> <br /> $Titlediv> <div style="width: 417px; height: 8px"> 瀏覽<font color="red"><script src="http://localhost/.Net/NewsFiles/ClickCount.aspx?NewsId=$NewsId">script>font>次 $Timediv> <div style="width: 417px; height: 100px"> $Contentdiv> <div style="width: 416px; height: 9px"> $Pagerdiv> <div style="width: 416px; height: 8px"> <form id="form1" action="../AddComment.aspx" style="margin:0px"> <input id="Text1" type="text" /><Img id="Image1" src="../../UserInfo/CheckCode.aspx"/><br /> <textarea id="CommentContent" cols="20" rows="2">textarea> <br /> <input id="NewsId" type="hidden" value="$NewsId"/> <input id="Button1" type="submit" value="button" /> <a href="../Display.aspx?NewsId=$NewsId">查看更多評(píng)論a>form> div> body> html>
2、VB.NET生成靜態(tài)頁(yè)面和分頁(yè)原理分析前態(tài)頁(yè)面 NewsAdd.aspx,就是一個(gè)表單,用來(lái)填寫(xiě)新聞的標(biāo)題和內(nèi)容。
<%...@ Page Language="C#" AutoEventWireup="false" validateRequest="false" CodeFile="NewsAdd.aspx.cs" Inherits="NewsAdd.Admin_AdminPanel_NewsAdd" %> <%...@ Register TagPrefix="FCKeditorV2" Namespace="FredCK.FCKeditorV2" Assembly="FredCK.FCKeditorV2" %> > <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>添加新聞title> head> <body> <form id="form1" runat="server"> <div> <asp:Label ID="Label2" runat="server" Text="標(biāo)題">asp:Label> <asp:TextBox ID="Title" runat="server" Width="325px">asp:TextBox><br /> <asp:Label ID="Label1" runat="server" Text="內(nèi)容">asp:Label> <FCKeditorV2:FCKeditor id="Content" basePath="~/FCKeditor/" runat="server" Height="400px" Width="70%">FCKeditorV2:FCKeditor> <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" /> <asp:Label ID="Message" runat="server" >asp:Label>div> form> body> html>
3、VB.NET生成靜態(tài)頁(yè)面和分頁(yè)原理后臺(tái)頁(yè)面 NewsAdd.aspx.cs
using System; using System.Data; using System.Configuration; using System.Collections; using System.Web; using System.Web.Security; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using Mysqlserver; using System.IO; using System.Text; namespace NewsAdd ...{ public partial class Admin_AdminPanel_NewsAdd : System.Web.UI.Page ...{ protected void Page_Load(object sender, EventArgs e) ...{ } protected void Button1_Click(object sender, EventArgs e) ...{ string strDate = DateTime.Now.ToString("yyMMdd") + "\" + DateTime.Now.ToString("yyyymmddhhmmss"); string strFileName = strDate + ".shtml";//存儲(chǔ)到數(shù)據(jù)庫(kù)中 string strTitle=Request.Form["Title"].ToString().Trim();//接收傳過(guò)來(lái)的標(biāo)題 string strContent=Request.Form["Content"].ToString().Trim();//接收傳過(guò)來(lái)的內(nèi)容 string[] content = strContent.Split(new Char[] ...{'|'});//對(duì)內(nèi)容進(jìn)行拆分,并保存到數(shù)組 int upbound = content.Length;//數(shù)組的上限 SqlServerDataBase db = new SqlServerDataBase(); bool success = db.Insert("insert into inNews(Title,Content,FilePath)values('" + strTitle + "','" + strContent + "','" + strFileName + "')", null); //if (success) // Message.Text = "添加成功!"; /**////////////////////////////創(chuàng)建當(dāng)前日期的文件夾開(kāi)始 string dir = Server.MapPath("../../"+"NewsFiles/"+DateTime.Now.ToString("yyMMdd"));//用來(lái)生成文件夾 if (!Directory.Exists(dir)) ...{ Directory.CreateDirectory(dir); }
以上是“VB.NET如何生成靜態(tài)頁(yè)面和分頁(yè)原理”這篇文章的所有內(nèi)容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內(nèi)容對(duì)大家有所幫助,如果還想學(xué)習(xí)更多知識(shí),歡迎關(guān)注億速云行業(yè)資訊頻道!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。