易截截图软件、单文件、免安装、纯绿色、仅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实现文件上传带进度条(多种风格)

文件上传 带进度条 多种风格 非常漂亮!
部分代码:
<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生成验证码

using System;
using System.Web;
using System.Drawing;
using System.Drawing.Imaging;
using System.IO;
public partial class images_code : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string chkCode = string.Empty;
//颜色列表,用于验证码、噪线、噪点
Color[] col ......

ASP.net 使用证书认证

要使 ASP.NET Web 应用程序能够使用客户端证书,您必须在本地计算机存储中安装客户端证书。如果您在本地计算机存储中安装客户端证书,则该客户端证书仅对管理员组中的用户帐户和安装该客户端证书的用户可用。因此,您必须向用于运行 ASP.NET Web 应用程序的用户帐户授权,使其能够访问客户端证书。
注意:必须安装 Microso ......

ASP.NET常见错误及解决方法

在ASP.NET出现错误时,应该先检查ASP.NET环境是否正确搭建,比如以下几个方面:
1、是否安装相应版本的.NET Framework程序,并打好了补丁。
2、IIS是否安装运行正常,站点路径及ASP.NET版本是否配置正确。
3、在IIS WEB服务扩展中,是否允许了ASP.NET扩展。
4、是否有安全防护软件禁止向Windows和Temp文件夹写入文 ......

ASP.NET快捷键

CTRL + SHIFT + B生成解决方案
CTRL + F7 生成编译
CTRL + O 打开文件
CTRL + SHIFT + O打开项目
CTRL + SHIFT + C显示类视图窗口
F4 显示属性窗口
SHIFT + F4显示项目属性窗口
CTRL + SHIFT + E显示资源视图
F12 转到定义
CTRL + F12转到声明
CTRL + ALT + J对象浏览
CTRL + ALT + F1帮助目录
CTR ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号