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

½«Í¼Æ¬µÈÎļþ±£´æµ½sqliteÖУ¨c#£©

 SqLite.netµÄdllΪSystem.Data.SQLite.dll£¬ÕâÖÖdll·ÖΪ32λ¡¢64λºÍÊÊÓÃÓÚcompactframeworkÈýÖÖ£¬ÔÚÒýÓÃʱҪעÒ⣬ѡÔñÕýÈ·µÄdll¡£
½«Òª±£´æͼƬµÄ×Ö¶ÎÀàÐÍÉèΪblob¡£´úÂëÈçÏ£º
private void savePicture£¨£©
{
using (SQLiteConnection cnn = new SQLiteConnection(dbPath))
{
cnn.Open();
using (SQLiteCommand cmd = cnn.CreateCommand())
{
//cmd.CommandText = "Create Table test(data Image)";
//cmd.ExecuteNonQuery();
cmd.CommandText = "insert into person values('12',@data,'14','13')";
SQLiteParameter para = new SQLiteParameter("@data", DbType.Binary);
string file = @"F:\Image\·É»ú.png";
FileStream fs = new FileStream(file, FileMode.Open);
//StreamUtil su = new StreamUtil();
//byte[] buffer = su.StreamToBytes(fs);
byte[] buffer = StreamUtil.ReadFully(fs);
fs.Close();
para.Value = buffer;
cmd.Parameters.Add(para);
cmd.ExecuteNonQuery();
}
}
}

ÆäÖÐStreamUtilΪ×Ô¶¨ÒåµÄÒ»¸öÀࣺ
public static class StreamUtil
{
const int BufferSize = 8192;
public static void CopyTo(Stream input,Stream output)
{
byte[] buffer = new byte[BufferSize];

int read;
while ((read = input.Read(buffer, 0, buffer.Length)) > 0)
{
output.Write(buffer, 0, read);
}
}

public static byte[] ReadFully(Stream input)
{
using (MemoryStream tempStream = new MemoryStream())
{
CopyTo(input, tempStream);
return tempStream.ToArray();
}
}

}

²Î¿¼£ºhttp://www.


Ïà¹ØÎĵµ£º

C# Á¬½ÓOracleÊý¾Ý¿â


C#Á¬½ÓOracleÊý¾Ý¿â×Ö·û´®
http://developer.51cto.com
 2009-08-20 17:55  ØýÃû  °Ù¶È¿Õ¼ä  ÎÒÒªÆÀÂÛ(
0
)
C#Á¬½ÓOracleÊý¾Ý¿âÒÔ¼°C#Á¬½ÓOracleÊý¾Ý¿â×Ö·û´®µÈÄÚÈݽ«ÔÚ±¾ÎÄÖÐÕ¹ÏÖ£¬Ï£Íû±¾ÎÄÄܶԴó¼ÒÁ˽âC#Á¬½ÓÊý¾Ý¿âÓÐËù°ïÖú¡£
C#Á¬½ÓOracleÊý¾Ý¿â×Ö·û´®£¨²éѯÊý¾Ý£©
using
 Syst ......

ËÑË÷֮· c#´ÓhtmlÖÐÌáÈ¡Îı¾

Ö±½Ó·â×°³ÉÒ»¸öÀàµÄ£¬ÓÃÆðÀ´»¹Í¦·½±ãµÄ
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.Text ......

asp.net c# request³£ÓÃ

using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
namespace pub.mo
{
public class request
{
private request() { }
/// <summary>
/// »ñÈ¡session
/// </summary>
/// <param name="_session_name" ......

C# µ¥ÊµÀýÉè¼Æģʽ

SingletonģʽµÄʵÏÖ
SingletonģʽµÄʵÏÖ»ùÓÚÁ½¸öÒªµã£º
1£©²»Ö±½ÓÓÃÀàµÄ¹¹Ô캯Êý£¬¶øÁíÍâÌṩһ¸öPublicµÄ¾²Ì¬·½·¨À´¹¹ÔìÀàµÄʵÀý¡£Í¨³£Õâ¸ö·½·¨È¡ÃûΪInstance¡£Public±£Ö¤ÁËËüµÄÈ«¾Ö¿É¼ûÐÔ£¬¾²Ì¬·½·¨±£Ö¤Á˲»»á´´½¨³ö¶àÓàµÄʵÀý¡£
2£©½«ÀàµÄ¹¹Ô캯ÊýÉèΪPrivate£¬¼´½«¹¹Ô캯Êý"Òþ²Ø"ÆðÀ´£¬ÈκÎÆóͼʹÓù¹Ô캯Êý´´½¨Ê ......

asp /asp.net c#Á´½ÓOrcale Êý¾Ý¿âµÄ·½°¸

1£¬ÔÚweb·þÎñÆ÷ÉÏ°²×°OracleÊý¾Ý¿â¿Í»§¶Ë£¬ÕâÊÇÁ¬½ÓOracleÊý¾Ý¿âµÄ»ù´¡£¨µ«£¬²»Ò»¶¨ÊDZØÐëµÄ£©¡£
2£¬ÔÚ¿Í»§¶ËµÄNet Manager ÖнøÐÐÅäÖ÷þÎñµÄÃû³Æ£¬ÅäÖÃÈçͼ£¨ÕâÒ»µã·Ç³£µÄÖØÒªÒÔºóµÄÁ´½ÓÈ«¶¼ÔÚÕâ¸ö·þÎñÃû³ÆµÄ»ù´¡ÉϽøÐеģ©
3£¬ASPÁ´½Ó·þÎñµÄÁ´½Ó×Ö·û´®ºÍ·½·¨ÈçÏ£º
<%
connstr= "Provider=MSDAORA.1;Password=***; ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ