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¿ª·¢µÄÍøÕ¾ÕûºÏ£¬ÓкܶàÈËÒѾÍê³ÉÁË¡£
µ«ÔÚÍøÉÏûÓÐÕÒµ½½ÏÏêϸµÄÃèÊö¡£·½·¨µ¹ÊÇÓкܶàÖÖ¡£
ÔÚÏîÄ¿ÖÐ×¢²áÐÂÓû§Ê±£¬Ò²Í¬Ê±µ÷ÓÃÂÛ̳µÄÓû§×¢²á£¬ÕâÑù¾Íͬ²½×¢²áÁË¡£ÖÁÓÚɾ ......
1. ´ò¿ªÐµĴ°¿Ú²¢´«ËͲÎÊý£º
´«ËͲÎÊý£º
response.write("£¼script£¾window.open('*.aspx?id="+this.DropDownList1.SelectIndex+"&id1="+...+"')£¼/script£¾")
½ÓÊÕ²ÎÊý£º
string a = Request.QueryString("id");
string b = Request.QueryString("id1");
2.Ϊ°´Å¥Ìí¼Ó¶Ô»°¿ò
Button1.Attributes. ......
ASP.NETÖ¸ÁîÔÚÿ¸öASP.NETÒ³ÃæÖж¼ÓС£Ê¹ÓÃÕâЩָÁî¿ÉÒÔ¿ØÖÆASP.NETÒ³ÃæµÄÐÐΪ¡£ÏÂÃæÊÇPageÖ¸ÁîµÄÒ»¸öÀý×Ó£º
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb"
Inherits="_Default" %>
ÔÚASP.NETÒ³Ãæ»òÓû§¿Ø¼þÖÐÓÐ11¸öÖ¸Áî¡£ÎÞÂÛÒ³ÃæÊÇʹÓúǫ́±àÂëÄ£ÐÍ»¹ÊÇÄÚÖñ ......
Ò»¡¢Page Àà
Page ÀàÓëÀ©Õ¹ÃûΪ .aspx µÄÎļþÏà¹ØÁª£»ÕâЩÎļþÔÚÔËÐÐʱ±»±àÒëΪ Page ¶ÔÏ󣬲¢±»»º´æÔÚ·þÎñÆ÷ÄÚ´æÖС£Èç¹ûÊÇʹÓôúÂëÒþ²Ø¼¼Êõ´´½¨ Web ´°ÌåÒ³£¬Çë´Ó¸ÃÀàÅÉÉú¡£
Àý£º£¨public partial class _Default : System.Web.UI.Page£©
Page ¶ ......