上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 107 下一页
摘要: private void Form1_DragEnter(object sender, System.Windows.Forms.DragEventArgs e) { if (e.Data.GetDataPresent(DataFormats.FileDrop)) e.Effect = DragDropEffects.Link; else e.Effect = DragDropEffects.None; } private void Form1_DragDrop(object sender, System.Windows.Forms.DragEventArgs e) { //其中label1. 阅读全文
posted @ 2007-03-24 16:53 leonardleonard 阅读(122) 评论(0) 推荐(0) 编辑
摘要: Code List: ------------------------------------------------------------------------- /***************************************************************** ** File Name: frmMain.cs ** Copyright (c) 1999 -2003 ** Creator: FirePhoenix ** Created Date: 2004-11-13 15:24 ** Modifier: ** Modify Date: ** Descr 阅读全文
posted @ 2007-03-24 16:52 leonardleonard 阅读(309) 评论(0) 推荐(0) 编辑
摘要: C# 出来也有些日子了,最近由于编程的需要,对 C# 的类型转换做了一些研究,其内容涉及 C# 的装箱/拆箱/别名、数值类型间相互转换、字符的 ASCII 码和 Unicode 码、数值字符串和数值之间的转换、字符串和字符数组/字节数组之间的转换、各种数值类型和字节数组之间的转换、十六进制数输出以及日期型数据的一些转换处理,在这里与大家分享—— 1. 装箱、拆箱还是别名   许多 C#.NET 的书上都有介绍 int - Int32 是一个装箱的过程,反之则是拆箱的过程。许多其它变量类型也是如此,如:short - Int16,long - Int64 等。对于一般的程序员来说,大可 阅读全文
posted @ 2007-03-24 16:51 leonardleonard 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 接口把一组公共方法和属性组合起来 ,以封装特定功能的一个集合。通过类可以实现接口,这样类就支持接口所有的属性和方法。 接口只能对方法和属性进行定义,不能实现,只能由支持它的类实现。接口中的成员不能用访问符修饰,如public,private,它的成员默认为public 定义接口比较简 单 public interface IMyinterface { void Dosomething();//方法成员 int MyAttribute//属性成员 { get;//这里只能定义这个属性是否为只读 set; } } 接口和抽象类比较相似,但一个类只能派生于一个抽象类,不过可以实现N个接口。 举个例子 阅读全文
posted @ 2007-03-24 16:49 leonardleonard 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 可以引用的COM组件列表,发现里面有一个名为Microsoft CDO For Exchange 2000 Library的COM组件,就是这个,我们可以用它来连接SMTP Server,使用用户名/密码验证发送邮件。 下面是实现的一个例子: Smtp Server使用的Smtp-SRV,登陆用户名是David Euler,发送邮箱是davidEuler@test.com,发送到test@test.com/ 1).资源管理器里面,添加引用(reference),添加Microsoft CDO For Exchange 2000 Library的COM组件; 2).编辑用户界面如上图,依次添加F 阅读全文
posted @ 2007-03-24 16:48 leonardleonard 阅读(584) 评论(0) 推荐(0) 编辑
摘要: public class XmlControl { protected string strXmlFile; protected XmlDocument objXmlDoc = new XmlDocument(); public XmlControl(string XmlFile) { // // TODO: 在这里加入建构函式的程序代码 // try { objXmlDoc.Load(XmlFile); } catch (System.Exception ex) { throw ex; } strXmlFile = XmlFile; } public DataView GetData(str 阅读全文
posted @ 2007-03-24 16:47 leonardleonard 阅读(107) 评论(0) 推荐(0) 编辑
摘要: 由于Content, Title中可能包含单引号,直接使用sql的insert命令会报错,对此有两种处理方法,一种将单引号替换成两个单引号,第2种方法是使用存储过程。 表myBBS的格式定义如下: CREATE TABLE [dbo].[myBBS] ( [ID] [bigint] IDENTITY (1, 1) NOT NULL , [Title] [char] (160) COLLATE Chinese_PRC_CI_AS NULL , [Author] [char] (20) COLLATE Chinese_PRC_CI_AS NULL , [Date_of_Created] [date 阅读全文
posted @ 2007-03-24 16:45 leonardleonard 阅读(223) 评论(0) 推荐(0) 编辑
摘要: 获取文件的版本信息: FileVersionInfo myFileVersionInfo1 = FileVersionInfo.GetVersionInfo("D:\\TEST.DLL"); textBox1.Text="版本号: " + myFileVersionInfo1.FileVersion; 更改文件属性,删除只读文件: 下例欲将E:\test.txt文件拷贝至D:\tmp\test.txt,但D:\tmp\test.txt已经存在。 //File.Copy(sourceFile,destinationFile,true); 用来拷贝文件 //当destinationFile已经存在 阅读全文
posted @ 2007-03-24 16:44 leonardleonard 阅读(137) 评论(0) 推荐(0) 编辑
摘要: XPButton.cs代码 using System; using System.Windows; using System.Drawing; using System.Drawing.Drawing2D; using System.Windows .Forms ; namespace XPCtrl { /// summary /// XPButton 的摘要说明。 /// /summary public class XPButton:System.Windows.Forms.Button { private bool mouseover=false; public XPButton( 阅读全文
posted @ 2007-03-24 16:42 leonardleonard 阅读(637) 评论(0) 推荐(0) 编辑
摘要: private AxSHDocVw.AxWebBrowser axWebBrowser1; private System.Windows.Forms.Button button1; private System.Windows.Forms.Label label1; private AxShockwaveFlashObjects.AxShockwaveFlash axShockwaveFlash1; System.Threading.Thread thread1=new System.Threading.Thread(new System.Threading.ThreadStart(threa 阅读全文
posted @ 2007-03-24 16:41 leonardleonard 阅读(457) 评论(0) 推荐(0) 编辑
上一页 1 ··· 10 11 12 13 14 15 16 17 18 ··· 107 下一页