- 博客(16)
- 资源 (4)
- 收藏
- 关注
原创 关于c#书的代码
记得以前刚学习编程的时候是学的c++,那时候刚刚接触编程,后面的习题都不知道怎么动手,想百度看下别人的代码找一下思路,,结果去百度,一般都是别人复制和粘贴的代码,有的和标题都不一致,那时候很苦恼,也没有人教.... 现在接触c#,在也没有遇到以前的那种苦恼了,希望能够帮助到那些和我以前遇到这种情况的人.代码都很简短,希望能够对有需要的人有一些帮助也就达成我的初衷了.
2012-10-02 01:34:50 363
原创 c# 链接sql server
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Data.SqlClient; namespace testConnectionSqlServer { class Program { static void Main
2014-02-27 12:32:29 675
原创 11_5_3给people添加GetOldest()方法,使用上面定义的重载运算符,返回一个Age最大的对象数组
//file Person.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Collections; namespace _11_5_1 { class Person : CollectionBase { pr
2012-10-25 04:49:06 861
原创 11_5_2扩展上一题中的Person 类,重载>、<、>=和<=运算符,比较Person实例的Age属性
//file Person.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace _11_5_1 { class Person { private string name; private int age;
2012-10-24 16:25:47 964
原创 11_5_1创建一个集合类People ,它是下述Person类的集合,该集合中的项可以通过一个字符串索引符来访问,该字符串索引符是人的姓名,与Person.Name 属性相同:
//file Program.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace _11_5_1 { class Program { static void Main(string[] args) {
2012-10-24 16:06:16 2401
原创 10_9_5为Ch10CardLib库编写一个控制台客户程序,从扰乱的Deck对象中一次取出5张牌.如果这5张牌都是相同的花色,客户程序就应在屏幕上显示这5张牌,以及文本"Flush",否则就显示50
//file name Suit.Cs using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace Ch10CardLib { public enum Suit { Club, //梅花 Diamond,
2012-10-10 01:35:44 3330
原创 10_9_4编写一个类MyCopyableClass,该类可以使用方法GetCopy()返回它本身的一个副本.这个方法应使派生与System.Object的MemberwiseClose()方法.该类
//file name MyCopyableClass.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace _10_9_4 { class MyCopyableClass : System.Object { privat
2012-10-09 02:18:26 1094
原创 10_9_2从类MyClass中派生一个类MyDervedClass,重写GetString(),使用该方法的基类实现代码从基类中返回一个字符串,但在返回的字符串中添加文本"(output fro)"
//file name MyClass.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace _10_9_1 { class MyClass { private string myString; publ
2012-10-08 22:51:02 1142
原创 10_9_1编写代码,定义一个基类MyClass,其中包括虚礼方法GetString(),这个方法返回存储在受保护字段myString中的字符串,该字段可以通过只写公共属性ContainedStrin
//file name MyClass.cs using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace _10_9_1 { class MyClass { private string myString; publ
2012-10-08 22:44:56 2464
原创 9_9_5创建一个控制台应用程序项目Traffic,它引用Vehicles.dll
//Vehicles.dll using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace _9_9_4 { //定义Vehicle基类 public abstract class Vehicle { string name;
2012-10-05 05:18:13 585
原创 9_9_4在类库项目Vehicles中编写代码,执行本章前面讨论的对象系列Vehicle,
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace _9_9_4 { //定义Vehicle基类 public abstract class Vehicle { string name; public
2012-10-05 05:03:40 760
原创 6_8_5在order结构体中添加一个函数.该结构体返回一个格式化的字符串,以合适的值替换用尖括号扩起来的条目
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace _6_8_5 { class Program { struct order { public string itemName;
2012-10-02 01:57:20 696
原创 6_8_4修改下面的结构体,使之包含一个返回订单总价格的函数.
/* 函数 * struct order * { * public string itenName; * public int unitCount; * public double unitCost; * } */ using System; using System.Collections.Generic; using System.Linq
2012-10-02 01:27:13 713
原创 6_8_3创建一个委托,在请求用户输入时,使用它模拟Console.ReadLine()函数
using System; using System.Collections.Generic; using System.Linq; using System.Text;namespace _6_8_3 { class Program { //创建 一个delegate delegate string ProcessDelegate(
2012-10-02 00:37:04 1305
原创 6_8_2编写一个应用程序,该程序使用2个命令行参数,分别把值放在一个字符串和一个整形变量中,然后显示这些值
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace _6_8_2 { class Program { static void Display(string str, int num) {
2012-10-01 20:51:09 2215
原创 编写一个控制台应用程序,给字符串中的每一个单词加上双引号.
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace _5_5_7 { class Program { static void Main(string[] args) { string s
2012-09-30 03:14:38 1141
IT学生解惑真经_过来人的忠告
2011-08-29
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人