asp.net¶ÔͼƬµÄ¶Áд
дͼƬc:\1.jpgµ½±ícinfoÖÐ
private static void AddCinfo()
{
string strSql = "insert into cinfo (srvtitle,csttitle,introduction,logo) values
(@srvtitle,@csttitle,@introduction,@logo)";
SqlParameter[] parms =
{
new SqlParameter("@srvtitle",SqlDbType.VarChar,30),
new SqlParameter("@csttitle",SqlDbType.VarChar,30),
new SqlParameter("@introduction",SqlDbType.NVarChar,500),
new SqlParameter("@logo",SqlDbType.Image)
};
parms[0].Value = "ÂÃÒµ»¥¶¯";
parms[1].Value = "lyhd";
parms[2].Value = "¼ò½é";
string filePath = @"c:\1.jpg";
FileStream fs = File.OpenRead(filePath);
byte[] content = new byte[fs.Length];
fs.Read(content, 0, content.Length);
fs.Close();
parms[3].Value = content;
DBHelper.ExecuteNonQuery(CommandType.Text, strSql, parms);
}
¶ÁȡͼƬµÄÒ³Ãæ test.aspx
protected void Page_Load(object sender, EventArgs e)
{
string strSql = "select * from cinfo where id=1";
SqlDataReader reader=DBHelper.ExecuteReader(CommandType.Text, strSql, null);
Ïà¹ØÎĵµ£º
ÓÉÓÚÏîÄ¿ÐèÒªÒ»¸öÂÛ̳£¬±¾À´ÓÐCSµÄ£¬ÔÚ.netϺܳöÃûµÄ¹úÍ⿪ԴÂÛ̳¡£µ«ÎªÁËÊÊÓ¦¹úÄڵķçÆø£¬×îºóÑ¡ÓÃÔÚ¹úÄÚÈçÈÕÖÐÌìµÄDiscuz!NT¡£
½«DiscuzÓëasp.net¿ª·¢µÄÍøÕ¾ÕûºÏ£¬ÓкܶàÈËÒѾÍê³ÉÁË¡£
µ«ÔÚÍøÉÏûÓÐÕÒµ½½ÏÏêϸµÄÃèÊö¡£·½·¨µ¹ÊÇÓкܶàÖÖ¡£
ÔÚÏîÄ¿ÖÐ×¢²áÐÂÓû§Ê±£¬Ò²Í¬Ê±µ÷ÓÃÂÛ̳µÄÓû§×¢²á£¬ÕâÑù¾Íͬ²½×¢²áÁË¡£ÖÁÓÚɾ ......
Request¶ÔÏó¹¦ÄÜÊÇ´Ó¿Í»§¶ËµÃµ½Êý¾Ý£¬³£ÓõÄÈýÖÖÈ¡µÃÊý¾ÝµÄ·½·¨ÊÇ£ºRequest.Form¡¢Request.QueryString£¬Request¡£ÆäµÚÈýÖÖÊÇÇ°Á½ÖÖµÄÒ»¸öËõд£¬¿ÉÒÔÈ¡´úÇ°Á½ÖÖÇé¿ö¡£¶øÇ°Á½ÖÖÖ÷Òª¶ÔÓ¦µÄFormÌύʱµÄÁ½ÖÖ²»Í¬µÄÌá½»·½·¨£º·Ö±ðÊÇPost·½·¨ºÍGet·½·¨¡£
Request ¶ÔÏóµÄÊôÐԺͷ½·¨± ......
<!--
/* Font Definitions */
@font-face
{font-family:ËÎÌå;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:SimSun;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
{font-family:"\@ËÎÌå" ......
ÏÖÔÚÄ£ÄâÔÚA·þÎñÆ÷ÉÏ·ÃÎÊB·þÎñÆ÷DÅÌϵÄÒ»¸öÎļþ test.txt
1 ÔÚA·þÎñÆ÷ web.config µÄ<system.web>ϼÓÈë<identity impersonate="true" userName="duzhe123.com" password="boosou.com"/>
2 Á½Ì¨·þÎñÆ÷É϶¼½¨Á¢Ò»¸öÕʺŠduzhe123.com£¬ÃÜÂëΪ boosou.com ¡£ºÇºÇ£¬ÕÊºÅºÍ ......
»ñÈ¡ÇëÇóµÄÒ³µÄHttpApplicationState ¶ÔÏó¡£
Ò»¡¢HttpApplicationState Àà
×÷ÓãºÆôÓà ASP.NET Ó¦ÓóÌÐòÖжà¸ö»á»°ºÍÇëÇóÖ®¼äµÄÈ«¾ÖÐÅÏ¢¹²Ïí¡£
ASP.NET Ó¦ÓóÌÐòµÄ¸ÅÄÊǵ¥¸ö Web ·þÎñÆ÷ÉϵÄij¸öÐéÄâĿ¼¼°Æä×ÓĿ¼·¶Î§ÄÚµÄËùÓÐÎļþ¡¢Ò³¡ ......