Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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 ÈçºÎ£ºÌí¼Ó¼òµ¥µÄÕ¾µãµ¼º½


      ¿ÉÒÔʹÓà SiteMapPath¡¢TreeView »ò Menu ¿Ø¼þΪÓû§ÌṩÔÚÍøÕ¾Öе¼º½µÄÒ»Öµķ½·¨¡£
SiteMapPath ¿Ø¼þÏÔʾµ¼º½Â·¾¶£¨Ò²³ÆÎª Breadcrumb »ò Eyebrow£©£¬¸Ã·¾¶ÏÔʾµ±Ç°Ò³µÄλÖò¢ÏÔʾ×÷Ϊ·µ»ØÖ÷Ò³µÄ·¾¶µÄÁ´½Ó¡£
˵Ã÷£º Èç¹ûÒ»¸ö .aspx Ò³°üº¬Ò»¸ö SiteMapPath ¿Ø¼þ£¬Îª³ÊÏִ˿ؼþ£¬±ØÐ ......

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


ÀíÂÛºÍʵ¼ù²»Ò»Ñù£¬ÀíÂÛÔٺã¬Ò²ÒªÄÜʵ¼ù²ÅÐС£
Èç¹ûÄã´ÓÀ´Ã»ÓÐд¹ý³ÌÐò£¬ÄÇô£¬ÔÚд³ÌÐò֮ǰ»¹ÊÇÏÈ¿´¿´Óï·¨Ö®ÀàµÄ»ù´¡£»Èç¹ûÄãд¹ý³ÌÐò£¬ÄÇôÄã¾Í¿ÉÒÔ±ßд³ÌÐò±ßѧϰ¡£
ÎÞÂÛÓÃʲôÓïÑÔдһ¸öÍøÕ¾£¬Æä¸ù±¾¶¼ÊDz¶à£¬Î޷ǾÍÊǶÔÊý¾Ý¿âµÄ²Ù×÷£¬Èç²åÈ롢ɾ³ý¡¢Ð޸ĺͲéѯ¡£
Àಢ²»¿ÉÅ¡£ÀàÎ޷ǾÍÊÇһЩº¯ÊýºÍÊôÐÔ£¬¶øÇÒ ......

ASP.NET ʹÓà XmlDataSource ¿Ø¼þɸѡÊý¾Ý


      ¿Éͨ¹ý½« XmlDataSource ¿Ø¼þµÄ XPath ÊôÐÔÉèÖÃΪ XPath ɸѡ±í´ïʽ£¬À´É¸Ñ¡¸Ã¿Ø¼þ¹«¿ªµÄ XML Êý¾Ý¡£Èç¹ûÒÑÖ¸¶¨¿ÉÀ©Õ¹Ñùʽ±íÓïÑÔ (XSL) Ñùʽ±íÀ´×ª»» XmlDataSource ¿Ø¼þ¹«¿ªµÄÊý¾Ý£¬ÔòÔÚת»»ºó»áÓ¦Óà XPath ɸѡ±í´ïʽ¡£
ÏÂÃæµÄ´úÂëʾÀýÑÝʾ°ó¶¨µ½ TreeView ¿Ø¼þµÄ XmlDataSource ¿Ø¼þ¡ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ