Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

ASP.NET(C#)ͼƬÉÏ´«Ñ¹Ëõ³ÉËõÂÔͼµÄ´úÂë

// °´Ä£°æ±ÈÀýÉú³ÉËõÂÔͼ£¨ÒÔÁ÷µÄ·½Ê½»ñȡԴÎļþ£©
//Éú³ÉËõÂÔͼº¯Êý
//˳Ðò²ÎÊý£ºÔ´Í¼ÎļþÁ÷¡¢ËõÂÔͼ´æ·ÅµØÖ·¡¢Ä£°æ¿í¡¢Ä£°æ¸ß
//×¢£ºËõÂÔͼ´óС¿ØÖÆÔÚÄ£°æÇøÓòÄÚ
public static void MakeSmallImg(System.IO.Stream fromFileStream,string fileSaveUrl,System.Double templateWidth,System.Double templateHeight)
{
//´ÓÎļþÈ¡µÃͼƬ¶ÔÏ󣬲¢Ê¹ÓÃÁ÷ÖÐǶÈëµÄÑÕÉ«¹ÜÀíÐÅÏ¢
System.Drawing.Image myImage = System.Drawing.Image.fromStream(fromFileStream,true);
//ËõÂÔͼ¿í¡¢¸ß
System.Double newWidth = myImage.Width , newHeight = myImage.Height;
//¿í´óÓÚÄ£°æµÄºáͼ
if(myImage.Width>myImage.Height || myImage.Width==myImage.Height)
{
if(myImage.Width > templateWidth)
{
//¿í°´Ä£°æ£¬¸ß°´±ÈÀýËõ·Å
newWidth = templateWidth;
newHeight = myImage.Height * (newWidth/myImage.Width);
}
}
//¸ß´óÓÚÄ£°æµÄÊúͼ
else
{
if(myImage.Height > templateHeight)
{
//¸ß°´Ä£°æ£¬¿í°´±ÈÀýËõ·Å
newHeight = templateHeight;
newWidth = myImage.Width * (newHeight/myImage.Height);
}
}
//È¡µÃͼƬ´óС
System.Drawing.Size mySize = new Size((int)newWidth,(int)newHeight);
//н¨Ò»¸öbmpͼƬ
System.Drawing.Image bitmap = new System.Drawing.Bitmap(mySize.Width,mySize.Height);
//н¨Ò»¸ö»­°å
System.Drawing.Graphics g = System.Drawing.Graphics.fromImage(bitmap);
//ÉèÖøßÖÊÁ¿²åÖµ·¨
g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.High;
//ÉèÖøßÖÊÁ¿,µÍËٶȳÊÏÖÆ½»¬³Ì¶È
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;
//Çå¿Õһϻ­²¼
g.Clear(Color.White);
//ÔÚÖ¸¶¨Î»Öû­Í¼
g.DrawImage(myImage , new System.Drawing.Rectangle(0, 0, bitmap.Width, bitmap.Height) ,
new System.Drawing.Rectangle(0, 0, myImage.Width,myImage.Height) ,
System.Drawing.GraphicsUnit.Pixel);
///ÎÄ×Öˮӡ
//System.Drawing.Graphics G=System.Drawing.Graphics.fromImage(bitmap);
//System.Drawing.Font f=new Font("ËÎÌå",10);
//System.Drawing.Brush b=new SolidBrush(Color.Black);
//G.DrawString("myohmine",f,b,10,10);
//G.Dispose();
///ͼƬˮӡ
//System.Drawing.Image copyImage = System.Drawing.Imag


Ïà¹ØÎĵµ£º

ASP.NET—fromÑéÖ¤

Step 1£ºÐ½¨Êý¾Ý¿â(¿â£ºMyForms £»±í£ºusers £»×ֶΣºID£¬userName, userPwd)£»
Step 2£ºÐ½¨ÍøÕ¾£¬web.config µÄÎļþÈ«²¿´úÂëÈçÏ£º
web.config µÄÈ«²¿´úÂë
<?xml version="1.0"?>
<configuration>
    <appSettings/>
    <connectionStrings/>
  ......

ASP.NETÅжÏQQÊÇ·ñÔÚÏß

/// <summary>
    /// »ñÈ¡QQµ±Ç°×´Ì¬£¨1£ºÔÚÏߣ¬0£º²»ÔÚÏߣ¬-1£º²»´æÔÚ£©
    /// </summary>
    /// <param name="qq">qqºÅ</param>
    /// <returns></returns>
    public static int GetQQS ......

ASP.NET Response.Redirect ¶ªÊ§ SessionµÄÎÊÌâ

×î½ü×öÁËÒ»¸öÏîÄ¿·¢ÏÖ Response.Redirect ºó Session »á¶ªÊ§£¬¸ãÁËÁ½ÌìÖÕÓÚ·¢ÏÖÎÊÌâËùÔÚ¡£
ÎÊÌâ´úÂë
Session["xxx"] = xxx;
Response.Redirect("yyy.aspx");

µ±Ò³ÃæÌø×ªµ½ yyy.aspx £¬ Session ¶ªÊ§£¬·ÃÎÊ Session[“xxx”] µÃµ½ null.
Ô­Òò£ºµ±asp.net Ö´ÐÐ Response.Redirect ʱ»á ......

ѧϰASP.NETÖÐÓöµ½µÄÎÊÌâ

ÈçºÎ°Ñ²Ù×÷µÄÊý¾ÝÌí¼Óµ½Êý¾Ý¿âÖУ¿
н¨´¥·¢Æ÷µÄ·½·¨¼°Ô­Àí£¿
½ÌʦÈçºÎÌí¼Ó(Éϱ¨)¿ÎÌ⣬ÊÇ·ñÊÇÓÃEXCEL»òÊÇÆäËûµÄ·½·¨OR add task£¨°üÀ¨ä¯ÀÀ¿ÎÌâ¡¢²éÔÄѧÉúÑ¡ÌâÇé¿ö£©£¿
½ÌʦÉóÉóºËÊÇ·ñͨ¹ý£¿
PLAN:
  ¸ü¸Ä¸öÈËÐÅÏ¢¡¢ÃÜÂëµÈ
½ÌʦµÇ¼¡¢Éϱ¨¿ÎÌâ ( ¼´ÊÇInsert Óï¾ä)£Û  Ìí¼Ó¿ÎÌâ ¡¢¿ÎÌâä¯ÀÀ £Ý
 ½ÌÊ¦È ......

Asp.net mvc

MVC(¼´Ä£ÐÍ-ÊÓͼ-¿ØÖÆÆ÷)
       MVC(Model-View-Controller)ÓÃÓÚ±íʾһÖÖÈí¼þ¼Ü¹¹Ä£Ê½.Ëü°ÑÈí¼þϵͳ·ÖΪÈý¸ö»ù±¾²¿·Ö:Ä£ÐÍ(Model),
ÊÓͼ(View)ºÍ¿ØÖÆÆ÷(Controller)
       MVCµÄÓŵ㣺
1¶à¸öÊÓͼ¶ÔÓ¦Ò»¸öÄ£Ð͵ÄÄÜÁ¦
......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ