自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

5分鐘讓你了解VB.NET生成靜態(tài)頁(yè)面和分頁(yè)原理

開發(fā) 后端
文章主要圍繞著VB.NET生成靜態(tài)頁(yè)面和分頁(yè)原理進(jìn)行展開分析,靜態(tài)頁(yè)面template.html,主要是定義了一些特殊字符,用來(lái)被替換,前態(tài)頁(yè)面 NewsAdd.aspx,就是一個(gè)表單,用來(lái)填寫新聞的標(biāo)題和內(nèi)容,后臺(tái)頁(yè)面NewsAdd.aspx.cs 。

程序員有的時(shí)候?yàn)橐恍┬〉膯栴}而煩惱,在這里幫大家解決一個(gè)關(guān)于VB.NET生成靜態(tài)頁(yè)面和分頁(yè)原理的分析,下面就來(lái)看代碼:

1、VB.NET生成靜態(tài)頁(yè)面和分頁(yè)原理靜態(tài)頁(yè)面template.html,主要是定義了一些特殊字符,用來(lái)被替換。

  1. > 
  2. <html> 
  3. <head> 
  4. <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> 
  5. <title>$Titletitle> 
  6. head> 
  7. <body> 
  8. <div style="width: 417px; height: 54px" align="center"> 
  9. <br /> 
  10. $Titlediv> 
  11. <div style="width: 417px; height: 8px"> 
  12. 瀏覽<font color="red"><script src="http://localhost/.Net/NewsFiles/ClickCount.aspx?NewsId=$NewsId">script>font>次  $Timediv> 
  13. <div style="width: 417px; height: 100px"> 
  14. $Contentdiv> 
  15. <div style="width: 416px; height: 9px"> 
  16. $Pagerdiv> 
  17. <div style="width: 416px; height: 8px"> 
  18. <form id="form1" action="../AddComment.aspx" style="margin:0px"> 
  19. <input id="Text1" type="text" /><Img id="Image1" src="../../UserInfo/CheckCode.aspx"/><br /> 
  20. <textarea  id="CommentContent" cols="20" rows="2">textarea> 
  21. <br /> 
  22. <input id="NewsId" type="hidden" value="$NewsId"/> 
  23. <input id="Button1" type="submit" value="button" /> 
  24. <a href="../Display.aspx?NewsId=$NewsId">查看更多評(píng)論a>form> 
  25. div> 
  26. body> 
  27. html> 

2、VB.NET生成靜態(tài)頁(yè)面和分頁(yè)原理分析前態(tài)頁(yè)面 NewsAdd.aspx,就是一個(gè)表單,用來(lái)填寫新聞的標(biāo)題和內(nèi)容。

  1. <%...@ Page Language="C#" AutoEventWireup="false" validateRequest="false" CodeFile="NewsAdd.aspx.cs" Inherits="NewsAdd.Admin_AdminPanel_NewsAdd" %> 
  2. <%...@ Register TagPrefix="FCKeditorV2" Namespace="FredCK.FCKeditorV2" Assembly="FredCK.FCKeditorV2" %> 
  3. > 
  4. <html xmlns="http://www.w3.org/1999/xhtml" > 
  5. <head runat="server"> 
  6. <title>添加新聞title> 
  7. head> 
  8. <body> 
  9. <form id="form1" runat="server"> 
  10. <div> 
  11. <asp:Label ID="Label2" runat="server" Text="標(biāo)題">asp:Label> 
  12. <asp:TextBox ID="Title" runat="server" Width="325px">asp:TextBox><br /> 
  13. <asp:Label ID="Label1" runat="server" Text="內(nèi)容">asp:Label> 
  14. <FCKeditorV2:FCKeditor id="Content" basePath="~/FCKeditor/"  runat="server" Height="400px" Width="70%">FCKeditorV2:FCKeditor> 
  15. <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" /> 
  16. <asp:Label ID="Message" runat="server" >asp:Label>div> 
  17. form> 
  18. body> 
  19. html> 

3、VB.NET生成靜態(tài)頁(yè)面和分頁(yè)原理后臺(tái)頁(yè)面 NewsAdd.aspx.cs

  1. using System;  
  2. using System.Data;  
  3. using System.Configuration;  
  4. using System.Collections;  
  5. using System.Web;  
  6. using System.Web.Security;  
  7. using System.Web.UI;  
  8. using System.Web.UI.WebControls;  
  9. using System.Web.UI.WebControls.WebParts;  
  10. using System.Web.UI.HtmlControls;  
  11. using Mysqlserver;  
  12. using System.IO;  
  13. using System.Text;  
  14. namespace NewsAdd  
  15. ...{  
  16. public partial class Admin_AdminPanel_NewsAdd : System.Web.UI.Page  
  17. ...{  
  18. protected void Page_Load(object sender, EventArgs e)  
  19. ...{  
  20. }  
  21. protected void Button1_Click(object sender, EventArgs e)  
  22. ...{  
  23. string strDate = DateTime.Now.ToString("yyMMdd") + "\" + DateTime.Now.ToString("yyyymmddhhmmss");  
  24. string strFileName = strDate + ".shtml";//存儲(chǔ)到數(shù)據(jù)庫(kù)中  
  25. string strTitle=Request.Form["Title"].ToString().Trim();//接收傳過來(lái)的標(biāo)題  
  26. string strContent=Request.Form["Content"].ToString().Trim();//接收傳過來(lái)的內(nèi)容  
  27. string[] content = strContent.Split(new Char[] ...{'|'});//對(duì)內(nèi)容進(jìn)行拆分,并保存到數(shù)組  
  28. int upbound = content.Length;//數(shù)組的上限  
  29. SqlServerDataBase db = new SqlServerDataBase();  
  30. bool success = db.Insert("insert into inNews(Title,Content,FilePath)values('" + strTitle + "','" + strContent + "','" + strFileName + "')", null);  
  31. //if (success)  
  32.    // Message.Text = "添加成功!";  
  33. /**////////////////////////////創(chuàng)建當(dāng)前日期的文件夾開始  
  34. string dir = Server.MapPath("../../"+"NewsFiles/"+DateTime.Now.ToString("yyMMdd"));//用來(lái)生成文件夾  
  35. if (!Directory.Exists(dir))  
  36. ...{  
  37. Directory.CreateDirectory(dir);  

【編輯推薦】

  1. VB.NET獲取硬盤信息四大法寶
  2. 講述VB.NET調(diào)用Excel的好處
  3. 簡(jiǎn)單例子概述VB.NET新窗體
  4. 描述VB.NET工程轉(zhuǎn)換成步驟
  5. 自己動(dòng)手實(shí)現(xiàn)VB.NET控件數(shù)組
責(zé)任編輯:田樹 來(lái)源: qqread
相關(guān)推薦

2009-11-03 10:09:48

VB.NET對(duì)象

2009-10-26 15:45:43

VB.NET類構(gòu)造

2009-11-03 11:01:45

VB.NET遠(yuǎn)程事件

2009-11-10 16:05:21

VB.NET格式化

2009-11-03 13:54:55

VB.NET繼承

2009-10-30 13:12:40

VB.NET創(chuàng)建類

2009-10-21 18:19:36

VB.NET實(shí)現(xiàn)拖放

2009-11-02 17:24:57

VB.NET語(yǔ)言

2009-11-04 13:12:33

VB.NET面向?qū)ο缶?/a>

2009-10-26 16:49:27

VB.NET正則表達(dá)式

2009-11-02 10:42:04

VB.NET EXCE

2009-11-02 09:43:01

VB.NET構(gòu)造函數(shù)

2009-10-26 19:09:50

VB.NET轉(zhuǎn)換形態(tài)

2024-04-28 12:55:46

redis頻道機(jī)制

2009-11-03 17:15:07

VB.NET開發(fā)Exc

2021-01-27 18:15:01

Docker底層宿主機(jī)

2017-06-07 18:40:33

PromiseJavascript前端

2023-07-15 18:26:51

LinuxABI

2009-10-23 11:33:52

VB.NET集成開發(fā)環(huán)

2009-11-10 11:54:12

VB.NET按鈕
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)