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

asp.net 生成静态页面

后台:
string strDate = DateTime.Now.ToString("yyMMdd") + "\\" + DateTime.Now.ToString("yyyyMMddHHmmss");
string strFileName = strDate + ".html";
string strTitle = this.Txt_C_Name.Text.Trim();
string strContent = this.Content.Value.Trim();
string[] content = strContent.Split(new Char[] { '^' });//对内容进行拆分,并保存到数组【^】
int upbound = content.Length;//数组的上限
//SqlServerDataBase db = new SqlServerDataBase();
//bool success = db.Insert("insert into inNews(Title,Content,FilePath)values('" + strTitle + "','" + strContent + "','" + strFileName + "')", null);
//if (success)
// Message.Text = "添加成功!";
/**/
///////////////////////////创建当前日期的文件夹开始
string dir = Server.MapPath("../Files/" + DateTime.Now.ToString("yyMMdd"));//用来生成文件夹
if (!Directory.Exists(dir))
{
Directory.CreateDirectory(dir);
}
/**/
///////////////////////////创建当前日期的文件夹结束
try
{
for (int i = 0; i < content.Length; i++)
{
//string[] newContent = new string[4];//定义和html标记数目一致的数组
StringBuilder strhtml = new StringBuilder();
//创建StreamReader对象
using (StreamReader sr = new StreamReader(Server.MapPath("Template/") + "\\template.html", Encoding.GetEncoding("gb2312")))
{
String oneline;
//读取指定的HTML文件模板
while ((oneline = sr.ReadLine()) != null)
{
strhtml.Append(oneline);
}
sr.Close();
}
//为标记数组赋值
//SqlServerDataBase db = new SqlServerDataBase();
//DataSet ds = db.Select("select top 1 NewsId from inNews order by NewsId desc"


相关文档:

该怎样学习asp.net呢?转贴

这是一篇转载的博文,看了这篇文章,大受启发。因此,稍作修改,转载到我的空间与大家分享,供有需要的同学学习,并呼吁大家一起来学ASP.NET技术!
 
  第一步 掌握一门.NET面向对象语言,C#或VB.NET ,在没有面向对象(OO)基础的情况下直接学ASP.NET是很痛苦的(我深有体会)。ASP.NET是一个全面向对象的技术, ......

jquery+ajax+json+asp.net学习笔记(一)

jquery中已经封装了ajax的过程,使用起来很简单:
通过get方式提交:
<html>
<head>
    <title>实现服务器时间实时变化</title>
    <script language="javascript" type="text/javascript" src="js/jquery-1.3.1.js"></script>
  & ......

jquery+ajax+json+asp.net学习笔记(二)

jquery通过post传递数据到服务器(不使用插件):
<html>
<head>
    <title>Untitled Page</title>
    <script language="javascript" type="text/javascript" src="js/jquery-1.3.1.js"></script>
    <script language="ja ......

ASP.NET 用户控件缓存

ASP.NET 用户控件缓存
前台添加
后台添加
CachePolicy.SetSlidingExpiration(true);
CachePolicy.Duration = TimeSpan.fromMinutes(Hongdong.WebUI.Utility.Cdouble(Hongdong.WebUI.Utility.GetAppSettingByName("cacheTime"))); ......

监视 ASP.NET 应用程序性能


有许多工具可以帮助您测试和监视 Web 应用程序的性能。ASP.NET 包括多个性能计数器,可以使用这些性能计数器来跟踪应用程序的执行。您还可以使用内置的 ASP.NET 跟踪功能来跟踪页或应用程序的代码执行。
注意:
一些可视化设计器包括用于测试 ASP.NET 应用程序的工具。例如,Microsoft Visual Studio 2005 提供 Applica ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号