摘要:using System;namespace np{class program{ static void Main() { contact c1=new class1(); contact c2=new class2(); c1.printf(); c2.printf(); Console.ReadKey(); }} public abstract class contact{ public virtual void printf() { Console.WriteLine("Th...
阅读全文
摘要:《李白沽酒》:李白无事街上走,提壶去打酒.遇店加一倍,见花喝一斗.五遇店和花,喝光壶中酒.试问此壶中,原有多少酒?原诗是三遇店和花,这里改成了五次,后面有提示:由于古代没有小数,所以都用整数。假设,壶中酒数都是整数,代码如下:using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace ConsoleApplication1{ class Program { static void Main(string[] args) { ...
阅读全文
摘要:一、用户属性mobile : mobiletelbadpwdcount : 0homephone : hometeluserprincipalname : Jack@m1.cngivenname : 名samaccountname : Jacktitle : 职务cn : Jackwhencreated : 2011/9/23 3:14:18displayname : 显示名称lastlogon : 129615905072762619dscorepropagationdata : 1601/1/1 0:00:00samaccounttype : 805306368countrycode :
阅读全文
摘要:C#中用XmlDocument写XMLC#,XML XmlDocument xmldoc = new XmlDocument(); XmlDeclaration xmldecl; xmldecl = xmldoc.CreateXmlDeclaration("1.0", "gb2312", null);////xml版本号,编码(简体中文) xmldoc.AppendChild(xmldecl); //加入一个根元素 XmlElement xmlelem; xmlelem = xmldoc.CreateElement("", "
阅读全文
摘要:/* * 名称: 个人程序 * 版本: V1.0 * 作者: 王海鹏(Jack) * 日期: 2011-05-17 * CLR版本: 4.0 * 命名空间名称: WHPFunction.Drawing * 文件名: AddImageWatermark.cs * *QQ : 383828353 *Email: wh2004_1@qq.com * */using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.IO;using System.Drawing;using
阅读全文
摘要:这几种访问方式使用介绍如下:(部分示例代码来源MSDN Magzine) EntityClient+EntitySQL 示例代码: string city = "London"; using (EntityConnection cn = new EntityConnection("Name=Entities")) { cn.Open(); EntityCommand cmd = cn.Create...
阅读全文