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

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));


Ïà¹ØÎĵµ£º

ÈçºÎ¼ÆËãMS SQLÓï¾äÖ´ÐеÄʱ¼ä»¹ÓÐc#


MSSQL:
declare @begin datetime
declare @End datetime
set @begin=getdate()
   --Ö´ÐеÄÓï¾äдÔÚÕâÀï
set @End=getdate()
select datediff(millisecond,@begin,@End) as Ö´ÐеÄʱ¼ä
--millisecond±íʾºÁÃë Èç¹û¿´Ãë¿ÉÒÔʹÓÃss
C#:
ºÜ¶àʱº ......

ASP.NET(C#)ÖÐweb.configÎļþÏê½â

Ò»¡¢ÈÏʶWeb.configÎļþ
   Web.config ÎļþÊÇÒ»¸öXMLÎı¾Îļþ£¬ËüÓÃÀ´´¢´æ ASP.NET Web Ó¦ÓóÌÐòµÄÅäÖÃÐÅÏ¢£¨Èç×î³£ÓõÄÉèÖÃASP.NET Web Ó¦ÓóÌÐòµÄÉí·ÝÑéÖ¤·½Ê½£©£¬Ëü¿ÉÒÔ³öÏÖÔÚÓ¦ÓóÌÐòµÄÿһ¸öĿ¼ÖС£µ±Äãͨ¹ý.NETн¨Ò»¸öWebÓ¦ÓóÌÐòºó£¬Ä¬ÈÏÇé¿öÏ»áÔÚ¸ùĿ¼×Ô¶¯´´½¨Ò»¸öĬÈϵÄWeb.configÎļþ£¬°üÀ¨Ä¬ÈÏ ......

ÓÃC#´´½¨XML[¼òµ¥´úÂë]

XmlDocument doc = new XmlDocument();
XmlDeclaration dec = doc.CreateXmlDeclaration("1.0", "GB2312", null);
doc.AppendChild(dec);
//´´½¨Ò»¸ö¸ù½Úµã£¨Ò»¼¶£©
XmlElement root = doc.CreateElement("First");
doc.AppendChild(root);
//´´½¨½Úµã£ ......

C# ¸ñʽ»¯Êä³öXML

ºÜ¶àʱºòÓÐÒ»¸öxml×Ö·û´®£¬Ã»Óл»ÐУ¬Ã»ÓÐËõ½ø£¬ÒªÉú³ÉxmlÎļþ²»Ò×ÔĶÁ¡£ÏÂÃæµÄ´úÂë¾ÍÊÇÔõô½«Ò»¸öÁ¬ÐøµÄxml×Ö·û´®¸ñʽ»¯Êä³ö
// a demo string
string xml = "<Root><Eles><Ele>abc</Ele><Ele>123</Ele></Eles></Root>";
System.Xml.XmlDocument doc = new System.Xml ......

C#×Ô¶¯¹Ø»úÔ´Âë

Ô´ÂëÈçÏ£º
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.IO;
using Microsoft.Win32;
namespace mv
{ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ