易截截图软件、单文件、免安装、纯绿色、仅160KB

asp.net生成静态网页

using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.IO;
using System.Text;
namespace xmlDemo
{
/**//// <summary>
/// staticWeb 的摘要说明。
/// </summary>
public class staticWeb : System.Web.UI.Page
{
protected System.Web.UI.WebControls.Label Label1;
protected System.Web.UI.WebControls.Label Label2;
protected System.Web.UI.WebControls.Label Label3;
protected System.Web.UI.WebControls.TextBox TextBox1;
protected System.Web.UI.WebControls.TextBox TextBox2;
protected System.Web.UI.WebControls.TextBox TextBox3;
protected System.Web.UI.WebControls.Button Button1;
private void Page_Load(object sender, System.EventArgs e)
{
// 在此处放置用户代码以初始化页面
}
public bool WriteFile(string strText,string strContent,string strAuthor)
{
string path = Server.MapPath("~/news/");
Encoding code = Encoding.GetEncoding("gb2312");
// 读取模板文件
string temp = Server.MapPath("~/news/text.htm");
StreamReader sr=null;
StreamWriter sw=null;
string str="";
try
{
sr = new StreamReader(temp, code);
str = sr.ReadToEnd(); // 读取文件
}
catch(Exception exp)
{
HttpContext.Current.Response.Write(exp.Message);
HttpContext.Current.Response.End();
sr.Close();
}
string htmlfilename=DateTime.Now.ToString("yyyyMMddHHmmss")+".htm";
// 替换内容
// 这时,模板文件已经读入到名称为str的变量中了
str =str.Replace("ShowArticle",strText); //模板页中的ShowArticle
str = str.Replace("biaoti",strText);
str = str.Replace("content",strContent);
str = str.Replace("author",strAuthor);
// 写文件
try
{
sw = new StreamWriter(path + htmlfilename , false, code);
sw.Write(str);
sw.Flush();
}
catch(Exception ex)
{
HttpContext.Current.Response.Write(ex.Message);
HttpContext.Current.Response.End();
}
finally
{
sw.Close();
}
return true;


相关文档:

ASP.NET Cookie使用


1.什么是cookie?
cookie 是一小段文本信息,伴随用户请求,在web服务器和浏览器之间传递。用户每次访问站点的时候,
web应用程序都可以读取cookie包含的信息。
假设在用户请求您的网站的某个页面时,您的应用程序不仅是返回请求的页面。同时也返回一个包含日期
和时间的cookie。用户的浏览器在获得页面的同时也获得 ......

学习asp.net比较完整的流程[转]

如果你已经有较多的面向对象开发经验,跳过以下这两步:
  第一步 掌握一门.NET面向对象语言,C#或VB.NET 我强烈反对在没系统学过一门面向对象(OO)语言的前提下去学ASP.NET。 ASP.NET是一个全面向对象的技术,不懂OO,那绝对学不下去!
  第二步 对.NET Framework类库有一定的了解 可以通过开发Windows Form应用程 ......

ASP.NET + CSS实现动态菜单突出显示当前页面

网上关于突出显示当前页面的文章有不少,但是基本都是关于实现静态菜单的高亮,讲到动态生成菜单高亮的文章至少我没有找到,在csdn上问了两天都没有答案,最后在一位朋友的回答中找到思路,先利用一个函数判断菜单是否是正在浏览的当前页,然后付给li一个id,利用css层叠id大于class的关系,把这个id定义成高亮样式。
aspx ......

asp.net实现文件上传带进度条(多种风格)

文件上传 带进度条 多种风格 非常漂亮!
部分代码:
<form id="form1" runat="server">
<asp:ScriptManager ID="scriptManager" runat="server" EnablePageMethods="true" />
<script type="text/javascript">
var intervalID = 0;
var progressBar;
var fileUpload;
var form;
// 进度条
fu ......

ASP.NET 2.0运行时简要分析

概述:
      本文基于ASP.NET 2.0的源代码,对ASP.NET 2.0运行时进行了简要的分析,希望能帮助你理解ASP.NET 2.0中请求处理过程及页面编译模型。
关键字:
     ASP.NET 2.0运行时,原理,请求处理,页面编译,ASP.NET 2.0 HTTP Runtime
主要类:
   &nb ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号