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¡¢ÊÓͼ״̬¡¢¿Ø¼þ״̬¡¢Òþ²ØÓò¡¢²éѯ×Ö·û´®¡¢¸ö ......
ÎÊ£ºÎªÊ²Ã´SessionÔÚÓÐЩ»úÆ÷ÉÏż¶û»á¶ªÊ§£¿
´ð£º¿ÉÄܺͻúÆ÷µÄ»·¾³ÓйØÏµ£¬±ÈÈ磺·À»ðǽ»òÕßɱ¶¾Èí¼þµÈ£¬³¢ÊԹرշÀ»ðǽ¡£
ÎÊ£ºÎªÊ²Ã´µ±µ÷ÓÃSession.Abandonʱ²¢Ã»Óм¤·¢Session_End·½·¨£¿
´ð£ºÊ×ÏÈSession_End·½·¨Ö»Ö§³ÖInProc£¨½ø³ÌÄڵģ©ÀàÐ͵ÄSession¡£Æä´ÎÒª¼¤·¢Session_End·½·¨£¬±ØÐë´æÔÚSession£¨¼´ÏµÍ³ÖÐÒÑ¾Ê¹Ó ......
ÐèÒªÒýÓõÄÀàÃû¿Õ¼ä
using System.Security.Cryptography;
using System.IO;
using System.text;
/// <summary>
/// ¼ÓÃÜ
// ......
Page.ClientScript.RegisterStartupScript(Page.GetType(), "message", "<script language='javascript' defer>alert('¼ÓÈëÔÝ´æ¼Ü³É¹¦£¡');</script>");
asp.net¼òµ¥¼ÓÃÜ
//using System.Web.Security;
System.Web.Security.FormsAuthentication.HashPasswordForStoringInConfig ......