C# ͼƬ²Ã¼ô
/// <summary>
/// ËõС²Ã¼ôͼƬ
/// </summary>
/// <param name="int_Width">ÒªËõС²Ã¼ôͼƬ¿í¶È</param>
/// <param name="int_Height">ÒªËõС²Ã¼ôͼƬ³¤¶È</param>
/// <param name="input_ImgUrl">Òª´¦ÀíͼƬ·¾¶</param>
/// <param name="out_ImgUrl">´¦ÀíÍê±ÏͼƬ·¾¶</param>
public void ImgReduceCutOut(int int_Width, int int_Height, string input_ImgUrl, string out_ImgUrl)
{
// £½£½£½ÉÏ´«±ê׼ͼ´óС£½£½£½
int int_Standard_Width = 160;
int int_Standard_Height = 160;
int Reduce_Width = 0; // ËõСµÄ¿í¶È
int Reduce_Height = 0; // ËõСµÄ¸ß¶È
int CutOut_Width = 0; // ²Ã¼ôµÄ¿í¶È
int CutOut_Height = 0; // ²Ã¼ôµÄ¸ß¶È
int level = 100; //ËõÂÔͼµÄÖÊÁ¿ 1-100µÄ·¶Î§
// £½£½£½»ñµÃËõС£¬²Ã¼ô´óС£½£½£½
if (int_Standard_Height * int_Width / int_Standard_Width > int_Height)
{
Reduce_Width = int_Width;
Reduce_Height = int_Standard_Height * int_Width / int_Standard_Width;
CutOut_Width = int_Width;
CutOut_Height = int_Height;
}
else if (int_Standard_Height * int_Width / int_Standard_Width < int_Height)
{
Reduce_Width = int_Standard_Width * int_Height / int_Standard_Height;
Reduce_Height = int_Height;
CutOut_Width = int_Width;
CutOut_Height = int_Height;
}
else
{
Reduce_Width = int_Width;
Reduce_Height = int_Height;
CutOut_Width = int_Width;
CutOut_Height = int_Height;
}
// £½£½£½Í¨¹ýÁ¬½Ó´´½¨Image¶ÔÏó£½£½£½
System.Drawing.Image oldimage = System.Drawing.Image.fromFile(Server.MapPath(input_ImgUrl));
Ïà¹ØÎĵµ£º
Ò»¡¢ÈÏʶWeb.configÎļþ
Web.config ÎļþÊÇÒ»¸öXMLÎı¾Îļþ£¬ËüÓÃÀ´´¢´æ ASP.NET Web Ó¦ÓóÌÐòµÄÅäÖÃÐÅÏ¢£¨Èç×î³£ÓõÄÉèÖÃASP.NET Web Ó¦ÓóÌÐòµÄÉí·ÝÑéÖ¤·½Ê½£©£¬Ëü¿ÉÒÔ³öÏÖÔÚÓ¦ÓóÌÐòµÄÿһ¸öĿ¼ÖС£µ±Äãͨ¹ý.NETн¨Ò»¸öWebÓ¦ÓóÌÐòºó£¬Ä¬ÈÏÇé¿öÏ»áÔÚ¸ùĿ¼×Ô¶¯´´½¨Ò»¸öĬÈϵÄWeb.configÎļþ£¬°üÀ¨Ä¬ÈÏ ......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Xml;
namespace WebApplication2
{
/// <summary>
/// XMLHelper XMLÎĵµ²Ù×÷¹ÜÀíÆ÷
&nb ......
XmlDocument doc = new XmlDocument();
XmlDeclaration dec = doc.CreateXmlDeclaration("1.0", "GB2312", null);
doc.AppendChild(dec);
//´´½¨Ò»¸ö¸ù½Úµã£¨Ò»¼¶£©
XmlElement root = doc.CreateElement("First");
doc.AppendChild(root);
//´´½¨½Úµã£ ......
public sealed class DbOper
{
///<summary>
/// DbOperÀàµÄ¹¹Ô캯Êý
///</summary>
private DbOper()
{
}
......
½ñÌìÓõ½Õâ¸ö£¬ÍøÉÏÕÒ¸ö²»´íµÄ£¬±£´æÏÂÀ´¡£
×¢Ò⣺Õâ¸ö·½·¨ÊÇ¿ìËٹػú£¬²»»á±£´æÄãµÄÈκÎδ±£´æÐÅÏ¢¡£
// Õâ¸ö½á¹¹Ì彫»á´«µÝ¸øAPI¡£Ê¹ÓÃStructLayout
[StructLayout(LayoutKind.Sequential, Pack = 1)]
internal struct TokPriv1Luid
{
public int Count;
public ......