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"
Ïà¹ØÎĵµ£º
×öÏîĿҲÓÐÒ»¶Îʱ¼äÁË£¬ÔÚ³ÌÐòÖÐÒ²Óöµ½ºÜ¶à°²È«·½ÃæµÄÎÊÌâ¡£Ò²¸Ã×ܽáÒ»ÏÂÁË¡£Õâ¸öÏîÄ¿ÊÇÒ»¸ö CMS ϵͳ¡£ÏµÍ³ÊÇÓà ASP.NET ×öµÄ¡£¿ª·¢µÄʱºò·¢ÏÖ΢Èí×öÁ˺ܶలȫ´ëÊ©£¬Ö»ÊÇÓÐЩÐÂÊÖ³ÌÐòÔ±²»ÖªµÀÔõô¿ªÆô¡£ÏÂÃæÎÒͨ¹ý¼¸¸ö·½Ãæ¼òµ¥½éÉÜ£º
¡¡¡¡1£ºSQL ×¢Èë
¡¡¡¡2£ºXSS
¡¡¡¡3£ºCSRF
¡¡¡¡4£ºÎļþÉÏ´«
SQL ×¢Èë
¡¡¡¡ÒýÆðÔÒ ......
ÔÚweb.configÖÐÐÞ¸ÄÐÞ¸ÄÊôÐÔ
1£º<configSections><configSections>ÖмÓÏÂÃæ´úÂë
<configSections>
<sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral ......
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 ......
1¡¢¸øweb.configÌí¼Ó<authentication>ÔªËØ
2¡¢¸øweb.configÎļþÌí¼Ó<forms>ÔªËØ
<forms name=".aspxauth" loginUrl="Login.aspx" protection="All" timeout="30" path="/" requireSSL="false" slidingExpiration="true" cookieless="UseDeviceProfile"></forms>
3¡¢FormsAuthentication.Redire ......