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 menutest
{
///
/// Conn µÄժҪ˵Ã÷¡£
///
// by kyo
// ´ËÀàÊÇÉú³É¾²Ì¬ÍøÒ³µÄС³ÌÐò
public class Conn
{
public Conn()
{
}
public static bool WriteFile(string strText,string strContent,string strAuthor)
{
string path = HttpContext.Current.Server.MapPath("/menutest/");
Encoding code = Encoding.GetEncoding("gb2312");
// ¶Áȡģ°åÎļþ
string temp = HttpContext.Current.Server.MapPath("/menutest/news/text.html");
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")+".html";
string htmlfilename="kyo.html";
// Ìæ»»ÄÚÈÝ
// Õâʱ,Ä£°åÎļþÒѾ¶ÁÈëµ½Ãû³ÆÎªstrµÄ±äÁ¿ÖÐÁË
str = str.Replace("ShowArticle",strText); //Ä£°åÒ³ÖеÄShowArticle
str = str.Replace("biaoti",strText);
str = str.Replace("content",strContent);
str = str.Replace("author",strAuthor);
// дÎļþ
try
{
Ïà¹ØÎĵµ£º
//private string datapatch = ConfigurationSettings.AppSettings["acessconn"];//Êý¾Ý¿âµØÖ·
private string datapatch = "db/global.asa";//Êý¾Ý¿âµØÖ·
///
/// È¡µÃdataset
//
/// ²éѯÓï¾ä
///
public DataSet GetDataSet(string Commandtext)
{&nbs ......
¸ßЧʹÓÃʹÓÃSQL»º´æÒÀÀµ
ASP.NET FrameworkÐÂÔöµÄÒ»¸ö·Ç³£Ç¿´óµÄ¹¦ÄÜÊÇSQL»º´æÒÀÀµ¡£¸Ã¹¦ÄÜÔÊÐíµ×²ãÊý¾Ý¿âÖеÄÊý¾ÝÐÞ¸Äʱ£¬×Ô¶¯µØÖØÐÂÔØÈ뻺´æµÄÊý¾Ý¡£
ÔÚʹÓþø¶Ô»º´æ¹ýÆÚ²ßÂÔ»òÕßµ¯ÐÔ»º´æ¹ýÆÚ²ßÂÔʱÓÐÒ»¸öȨºâ£¬¶ÔÓÚÐÔÄܺͳ¾ÉÊý¾ÝµÄȨºâ¡£ÀýÈ磬Èç¹ûÔÚÄÚ´æÖлº´æÊý¾Ý20Ã룬ÔòÕâ20ÃëÄÚÏÔʾµÄÊý¾Ý¿ÉÄÜÊǹ ......
ASP.NetÓʼþ·¢ËÍÀà
±¾ÎÄת×Ô£ºhttp://www.pcstu.com/program/Asp_net/sl/20070706/52523.html
˵Ã÷£º±¾ÎÄûÓвâÊÔ£¬µ«¿´ÆðÀ´Ëƺõ²»ÄÜÓÃÓÚ·¢Ë͸½¼þ£¬ÈçÒª·¢Ë͸½¼þ£¬¿É²Î¿¼£ºhttp://blog.csdn.net/lff642/archive/2008/07/15/2654346.aspx
using System;
using System.Text;
using System.IO;
using System.Net;
using ......
ÔÌûµØÖ·£ºhttp://www.wangchao.net.cn/bbsdetail_572426.html
¼ò½é
¡¡¡¡ÓÐÐí¶à´ÏÃ÷µÄ°ì·¨¿ÉÒÔ½â¾öHTTPÐÒéµÄÎÞ״̬ÎÊÌ⣬ÀýÈç¶Ôÿ¸öÇëÇóÖØ¸´·¢ËÍÓ¦ÓóÌÐòÊý¾Ý°ü¡¢Ê¹ÓÃHTTPÈÏÖ¤»úÖÆÀ´½«ÇëÇóÓ³Éäµ½ÌØ¶¨µÄÓû§¡¢Ê¹ÓÃCookieÀ´´æ´¢Ò»ÏµÁÐÇëÇóµÄ״̬µÈ¡£ÔÚASP.net¼¼ÊõÖÐÌṩÁË ......
ʹÓÃDataRelationÀà´´½¨¹ØÏµ²¢ÀûÓø¸/×Ó¹ØÏµ¶ÁÈ¡Êý¾ÝʾÀý
void Page_Load(object sender, System.EventArgs e)
{
// Á¬½Ó×Ö·û´®ºÍ SQL Óï¾ä
string ConnString = System.Configuration.ConfigurationSettings.AppSettings["ConnectionSqlServer"];
......