asp.net ÉÏ´«ÅжÏÎļþÊÇ·ñΪͼƬ
private bool IsPicture(string filePath)//filePathÊÇÎļþµÄÍêÕû·¾¶
{
try
{
FileStream fs = new FileStream(filePath, FileMode.Open, FileAccess.Read);
BinaryReader reader = new BinaryReader(fs);
string fileClass;
byte buffer;
byte[] b=new byte[2];
buffer = reader.ReadByte();
b[0] = buffer;
fileClass = buffer.ToString();
buffer = reader.ReadByte();
b[1]=buffer;
fileClass += buffer.ToString();
reader.Close();
fs.Close();
if (fileClass == "255216 ")//255216ÊÇjpg;7173ÊÇgif;6677ÊÇ
Ïà¹ØÎĵµ£º
ASP.NET·þÎñÆ÷¿Ø¼þÖ®ÊÓͼ״̬
ΪWebÒ³Ãæ¼°Æä¿Ø¼þ±£³Ö״̬ÐÅÏ¢ÊǷdz£ÓбØÒªµÄ¡£È»¶ø£¬ÓÉÓÚWebÓ¦ÓóÌÐò´´½¨ÓÚHTTPÐÒéµÄ¶¥²ã£¬ÕâÊÇÒ»¸öÎÞ״̬µÄÐÒ飬Òò´Ë£¬±£³Ö״̬ÐÅÏ¢Ôò±äµÃ·Ç³£À§ÄÑ¡£ÎªÁ˽â¾öÕâ¸öÎÊÌ⣬ASP.net 2.0¼¼ÊõÌṩÁ˶àÖÖ½â¾ö·½°¸£¬ÀýÈ磬ÀûÓÃSession¡¢Cookie¡¢ÊÓͼ״̬¡¢¿Ø¼þ״̬¡¢Òþ²ØÓò¡¢²éѯ×Ö·û´®¡¢¸ö ......
²»¹ÜʹÓÃÄÄÖÖµ×²ãÆ½Ì¨£¬¿É¿¿ÐÔºÍÐÔÄܶ¼ÊǶÔËùÓÐ Web Ó¦ÓóÌÐòµÄÖ÷ÒªÒªÇ󣬾¡¹Ü´ÓijÖÖÒâÒåÉϽ²£¬ÕâÁ½¸öÒªÇóÊÇÏ໥ì¶ÜµÄ¡£ÀýÈ磬Ҫ¹¹½¨¸ü¿É¿¿¡¢¸ü½¡×³µÄÓ¦ÓóÌÐò£¬¿ÉÄÜÐèÒª½« Web ·þÎñÆ÷Óë¾ßÌåµÄÓ¦ÓóÌÐò·ÖÀ룬ʹӦÓóÌÐòÔÚ½ø³ÌÍ⹤×÷¡£µ«ÊÇ£¬Èç¹ûÔÚ²»Í¬ÓÚ Web ·þÎñÆ÷½ø³ÌµÄÄÚ´æ»·¾³Öй¤×÷£¬Ó¦ÓóÌÐò½«±äÂý¡£Òò´Ë£¬ÐèÒª²ÉÈ¡º ......
¹ØÓÚ asp.net ·þÎñÆ÷¿Ø¼þ¼¸¸ö ID µÄ˵Ã÷[ZT]
Òý×Ô:http://lujf1978.blog.163.com/blog/static/2320126620078114112822/
¶ÔÓÚÿһ¸ö·þÎñÆ÷¿Ø¼þSystem.Web.UI.Control ¶¼¾ßÓÐ ID£¬UniqueID£¬ClientID Èý¸öÊôÐÔ£¬ÄÇôÕâ¸öÈýÕßµ½µ×ÓкӹØÏµ£¬ÔÚ¿Í»§¶ËHTMLÖÐÓÖÊÇÈçºÎ¶ÔÓ¦³ÊÏÖµÄÄØ£¿
ID£º»ñÈ¡»òÉèÖ÷ÖÅ䏸·þÎñÆ÷¿Ø¼þµÄ ......
·½·¨Ò»:javascript·¨ function btnClear() { for(i=0;i /// Çå¿ÕÖ¸¶¨Ò³ÃæÉÏËùÓеĿؼþÄÚÈÝ£¬°üÀ¨TextBox£¬CheckBox,CheckBoxList,RadioButton,RadioButtonList¡£µ«ÊDz»Çå /// ³ýÈçListBox£¬DropDownList£¬ÒòΪÕâÑùµÄ¿Ø¼þÖµ¶Ôµ±Ç°Ò³ÃæÀ´Ëµ»¹¿ÉÒÔÓã¬Ò»°ãÕâЩ¿Ø¼þÀï¶¼ÊDZ£´æµÄ×ÖµäÊý¾Ý¡£ /// Author£ºKevin /// ÈÕÆÚ£º2004-12 ......
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.OleDb;
/// <summary>
/// Data ......