
C#
ll_newboy
这个作者很懒,什么都没留下…
展开
-
VS2005发送电子邮件
/**//// /// 发送邮件 /// /// /// /// /// public static bool SendEmail(string sendTo, string subject, string body) ...{ SmtpSection cfg = NetSectionGroup.GetSectio转载 2007-07-11 13:40:00 · 851 阅读 · 0 评论 -
获取图片
@ WebHandler Language="C#" Class="Handler" %>using System;using System.IO;using System.Drawing;using System.Web;public class Handler : IHttpHandler ...{ public void ProcessRequest(HttpContext con原创 2008-01-11 17:30:00 · 727 阅读 · 0 评论 -
删除文件文件或图片
/**//// /// 删除文件文件或图片 /// /// 当前文件的路径 /// 是否删除成功 public static bool FilePicDelete(string path) ...{ bool ret = false; System.IO.FileInfo file = new System.IO原创 2008-01-11 11:53:00 · 492 阅读 · 0 评论 -
处理图片
/**//// /// Resize图片(不成功返回null) /// /// 原始Bitmap /// 新的宽度 /// 新的高度 /// 处理以后的图片 public static Bitmap ResizeImage(Bitmap bmp, int newW, int newH) ...{ try .原创 2008-01-11 11:26:00 · 517 阅读 · 0 评论 -
导出excel
private void ExportExcel(System.Data.DataTable ds, string strExcelFileName) ...{ object objOpt = Missing.Value; Excel.Application excel = new Excel.Application();原创 2008-01-11 11:02:00 · 537 阅读 · 0 评论 -
打开一个文件
if (File.Exists(string.Format("{0}/{1}", System.Windows.Forms.Application.StartupPath, "入库明细表.xls"))) System.Diagnostics.Process.Start(string.Format("{0}/{1}", System.Wind原创 2008-01-11 11:00:00 · 495 阅读 · 0 评论 -
给报表设置参数
ReportParameter showDescParameter = new ReportParameter("showDescriptions", this.akshowDescriptionsCheckBox.Checked ? "true" : "false"); this.reportViewer1.LocalReport.SetParameters(new R原创 2008-03-10 14:11:00 · 763 阅读 · 0 评论 -
统计文件夹大小
private long GetFilesSize(String path) ...{ DirectoryInfo directoryInfo = new DirectoryInfo(path); long length = 0; foreach (FileSystemInfo fsi in directoryIn原创 2007-11-19 10:20:00 · 623 阅读 · 0 评论 -
获取repeater中的控件
foreach (RepeaterItem item in rptCustomer.Controls) ...{ if (item.ItemType == ListItemType.Item) ...{ item.FindControl("btnDelete").Visible =原创 2007-09-03 14:34:00 · 849 阅读 · 0 评论 -
网站验证码
private void Page_Load(object sender, System.EventArgs e) ...{ this.CreateCheckCodeImage(GenerateCheckCode()); } Web 窗体设计器生成的代码#region Web 窗体设计器生成的代码 override protected void On转载 2007-08-29 16:13:00 · 581 阅读 · 0 评论 -
挂起绑定
otherPhonePrefixBindingSource.SuspendBinding();//上面是挂起,下面是恢复过来,操作的是DataGridViewotherPhonePrefixBindingSource.ResumeBinding();原创 2007-08-02 17:15:00 · 601 阅读 · 0 评论 -
WinForm中打开web页面
System.Windows.Forms.Help.ShowHelp(this, url);System.Diagnostics.Process.Start("IExplore.exe", url);原创 2007-07-28 16:05:00 · 1125 阅读 · 0 评论 -
DataGridView同时删除多行
private void button1_Click(object sender, EventArgs e) ...{ this.hostTableAdapter.Fill(this.hostScanDataSet.host); } private void button2_Click(object sender, EventAr转载 2007-07-28 15:47:00 · 1127 阅读 · 0 评论 -
Return 键转 Tab 键功能代码
using System;using System.Collections.Generic;using System.Text;using System.Windows.Forms;using System.ComponentModel;namespace ControlLibrary...{ /**//// /// 为此项目定制的 MaskedTextbox,具有 Return原创 2007-07-20 16:16:00 · 903 阅读 · 0 评论 -
读取枚举类中的值
/**//// /// 获得枚举的值 /// /// public static IList ListType() ...{ ArrayList list = new ArrayList(); foreach (int i in Enum.GetValues(typeof(O转载 2007-07-16 12:56:00 · 911 阅读 · 0 评论 -
随机生成16位数字
/**//// /// 生成一个16位数字随机数 /// /// public string ReturnRandomStr() ...{ Random r = new Random(System.Environment.TickCount); str原创 2007-07-11 17:15:00 · 10896 阅读 · 1 评论 -
rdlc 显示条码
/// /// 生成条码图片 /// /// /// public static Bitmap GetCode39(string strSource) { int x = 5; //左邊界 int y = 5; //上邊界转载 2009-12-20 16:43:00 · 4050 阅读 · 0 评论