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

C#±È½ÏͼƬÊÇ·ñÒ»ÖÂ


/// <summary>
/// ±È½ÏÁ½·ùͼƬÊÇ·ñÒ»Ö£¨Ê¹ÓÃMarshal.ReadByte·½Ê½£©
/// </summary>
/// <param name="bitmap1">ͼƬ1</param>
/// <param name="bitmap2">ͼƬ2</param>
/// <returns>Èç¹ûÁ½·ùͼƬÏàͬ£¬·µ»Ø0£»Èç¹ûͼƬ1СÓÚͼƬ2£¬·µ»ØÐ¡ÓÚ0µÄÖµ£»Èç¹ûͼƬ1´óÓÚͼƬ2£¬·µ»Ø´óÓÚ0µÄÖµ¡£</returns>
public static int BitmapCompare3(Bitmap bitmap1, Bitmap bitmap2)
{
  int result = 0; //¼ÙÉèÁ½·ùͼƬÏàͬ
  if (bitmap1 == null || bitmap2 == null)
   return -1;
  if (bitmap1.Width == bitmap2.Width && bitmap1.Height == bitmap2.Height)
  {
   BitmapData bmd1 = bitmap1.LockBits(new Rectangle(0, 0, bitmap1.Width, bitmap1.Height), ImageLockMode.ReadOnly, bitmap1.PixelFormat);
   BitmapData bmd2 = bitmap2.LockBits(new Rectangle(0, 0, bitmap2.Width, bitmap2.Height), ImageLockMode.ReadOnly, bitmap2.PixelFormat);
   IntPtr start1 = bmd1.Scan0;
   IntPtr start2 = bmd2.Scan0;
   int sizeOfByte = Marshal.SizeOf(typeof(byte));
   for (int i = 0; i < sizeOfByte * bmd1.Stride * bitmap1.Height; i++)
   {
    byte b1 = Marshal.ReadByte(start1, i);
    byte b2 = Marshal.ReadByte(start2, i);
    if (b1 != b2)
    {
     result = (int)(b1 - b2);
     break;
    }
   }
   bitmap1.UnlockBits(bmd1);
   bitmap2.UnlockBits(bmd2);
  }
  else if (bitmap1.Width != bitmap2.Width)
  {
   result = bitmap1.Width - bitmap2.Width;
  }
  else if (bitmap1.Height != bitmap2.Height)
  {
   result = bitmap1.Height - bitmap2.Height;
  }
  return result;
}
==================================================================================
/// <s


Ïà¹ØÎĵµ£º

c# ¶ÁдXMLÎļþ

¡¡¡¡¡¡ÓÃc#¸øPDA×öÁËÒ»¸öPC¶ËµÄͨѶ³ÌÐò£¬ÐèÒª±£´æÁ½¸ö²ÎÊý¡£ÓÃDelphiʱ£¬ÊDZ£´æÔÚiniÎļþÖУ¬c#¶ÁдXML±È½Ï·½±ã£¬¾ÍÓÃxmlÎļþÀ´±£´æÁË¡£
¡¡¡¡¡¡
¡¡
class CXmlClass
{
private string XmlFilePath;
/// <summary>
/// ÏÂÔØµ½PDAµÄTXTÎļþ·¾¶¡¡
/// </summary>
......

c#Æô¶¯Sql Server·þÎñ

³ÌÐòÆô¶¯Sql ServerÆäʵºÜ¼òµ¥
´úÂ룺
System.ServiceProcess.ServiceController   myController   =
new   System.ServiceProcess.ServiceController("MSSQL$ACCP4444"); //·þÎñÃû³Æ ÕÒÁ˰ëÌì²ÅÕÒµ½£¬±¿ËÀÎÒÍêÁË¡£ÔÚ·þÎñÉÏÓÒ¼üÊôÐÔ£¬ÄÜ¿´µ½
if (myController.CanStop)
{ }
else ......

asp.netc#AccessͨÓÃÊý¾Ý·ÃÎÊÀà

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.OleDb;
/// <summary>
/// Data ......

Microsoft.NET±à³ÌÓïÑÔ C#½Ì³Ì

±¾ÊéÊÇ΢Èí¼¼ÊõÅàѵͳ±à½Ì²ÄÖ®Ò»£¬¶Ô±à³ÌÓïÑÔC#½øÐÐÁËÏêϸµÄ½éÉÜ¡£ C#ÊÇ»ùÓÚ΢ÈíÏÂÒ»´ú²Ù×÷ƽ̨£®NETµÄȫеÄÃæÏò¶ÔÏóµÄ³ÌÐòÉè¼ÆÓïÑÔ¡£ËüÔÚ±£³ÖÁËC+ÖÐÊìϤµÄÓï·¨µÄͬʱ£¬Ìí¼ÓÁË´óÁ¿µÄ¸ßЧ´úÂëºÍÍêÈ«ÃæÏò¶ÔÏóÌØÐÔ£¬ÒÔ¼°¸ü¸ßµÄ¿É¿¿ÐԺͰ²È«ÐÔ¡£C#ÓïÑÔ½«ÔÚ±£³ÖC£¯C++Áé»îÐԵĻù´¡ÉÏΪ³ÌÐòÔ±´øÀ´¸ü¸ßЧµÄ¿ª·¢·½Ê½¡£Ëü²»½öÄÜÓÃÓ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ