摘要: First Add This Namespacesusing System;using System.Collections.Generic;using System.Text;using System.Security;using System.Security.Cryptography;using System.Runtime.InteropServices;using System.Text.RegularExpressions;using System.IO;using System.Windows.Forms; Now The Function: public void Encryp 阅读全文
posted @ 2012-04-01 14:43 sandeepparekh9 阅读(162) 评论(0) 推荐(0) 编辑
摘要: public static object FileToObject(string _FileName) { try { // Open file for reading System.IO.FileStream _FileStream = new System.IO.FileStream(_FileName, System.IO.FileMode.Open, System.IO.FileAccess.Read); // attach file... 阅读全文
posted @ 2012-04-01 14:41 sandeepparekh9 阅读(135) 评论(0) 推荐(0) 编辑
摘要: public static void DataTablToListView(DataTable dt, ListView lst) { for (int j = 0; j < dt.Columns.Count; j++) { lst.Columns.Add(dt.Columns[j].ColumnName); } for (int i = 0; i < dt.Rows.Count; i++) { DataRow dr = dt.Rows[i];... 阅读全文
posted @ 2012-04-01 14:40 sandeepparekh9 阅读(186) 评论(0) 推荐(0) 编辑
摘要: public static bool ObjectToFile(object _Object, string _FileName) { try { // create new memory stream System.IO.MemoryStream _MemoryStream = new System.IO.MemoryStream(); // create new BinaryFormatter System.Run... 阅读全文
posted @ 2012-04-01 14:40 sandeepparekh9 阅读(109) 评论(0) 推荐(0) 编辑
摘要: public static Image GetImageThumbNail(Image img,int mWidth,int mHeight) { Image.GetThumbnailImageAbort myCallback = new Image.GetThumbnailImageAbort(ThumbnailCallback); img = img.GetThumbnailImage(mWidth , mHeight , myCallback, IntPtr.Zero); return img; } p... 阅读全文
posted @ 2012-04-01 14:39 sandeepparekh9 阅读(148) 评论(0) 推荐(0) 编辑
摘要: public static GraphicsPath GetRoundPath(Rectangle r, int depth) { GraphicsPath graphPath = new GraphicsPath(); graphPath.AddArc(r.X, r.Y, depth, depth, 180, 90); graphPath.AddArc(r.X + r.Width - depth, r.Y, depth, depth, 270, 90); graphPath.AddArc(r.X + r.Wid... 阅读全文
posted @ 2012-04-01 14:38 sandeepparekh9 阅读(140) 评论(0) 推荐(0) 编辑
摘要: public static string FirstLetterCapital(string strData) { string strReturn = string.Empty; strReturn = strData[0].ToString().ToUpper(); for (int i = 1; i < strData.Length; i++) { strReturn += strData[i].ToString().ToLower(); ... 阅读全文
posted @ 2012-04-01 14:37 sandeepparekh9 阅读(115) 评论(0) 推荐(0) 编辑
摘要: public static Image byteArrayToImage(byte[] byteArrayIn) { MemoryStream ms = new MemoryStream(byteArrayIn); Image returnImage = Image.FromStream(ms); return returnImage; } 阅读全文
posted @ 2012-04-01 14:36 sandeepparekh9 阅读(127) 评论(0) 推荐(0) 编辑
摘要: public static byte[] imageToByteArray(System.Drawing.Image imageIn){MemoryStream ms = new MemoryStream();imageIn.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg);return ms.ToArray();} 阅读全文
posted @ 2012-04-01 14:33 sandeepparekh9 阅读(98) 评论(0) 推荐(0) 编辑
摘要: public static System.Drawing.Bitmap ResizeImage(System.Drawing.Image image, int width, int height) { //a holder for the result Bitmap result = new Bitmap(width, height); //use a graphics object to draw the resized image into the bitmap using (Graphi... 阅读全文
posted @ 2012-04-01 09:48 sandeepparekh9 阅读(154) 评论(0) 推荐(0) 编辑