Windows程序(C# VS 2008)杂记之重命名项目名、项目文件夹、命名空间

本文记录了在C#环境下使用Visual Studio 2008进行项目重命名的步骤,包括项目名、项目文件夹和命名空间的修改,以及如何避免命名冲突导致的编译错误。通过实例展示了如何重构命名空间,更改DLL文件名,以及更新引用,确保程序正常运行。
摘要由CSDN通过智能技术生成

2014年4月24日星期四

最近在学习数据结构,了解到的第一种很简单的数据结构是Bag,用数组来实现。

在真正实现的时候,我希望建一个类库项目来具体实现数据结构,为了一目了然,我把项目名取为Bag。在类库项目Bag下面,会有一个默认的类文件class1.cs。


这儿我将这个类文件给删除了,然后重新添加了一个,命名为Bag.cs的类文件。然后在Bag.cs里面写实现代码,右击项目名,选择“生成”,生产bag.dll文件。Bag.cs的实现代码如下:

// FILE://Bag.cs

// CLASS IMPLMENT: class Bag

//

// CONSTRUCTORS for classBag

// Bag():

//   Postcondition: default constructor, generatean instance of the bag class

//   and the capacity of the bag class is 30

//

// Bag(bag_size size):

//   Postcondition: generate an instance of thebag class, and the capacity is

//   decided by the parameter users provide

//

// MODIFICATION MEMBERMETHODS for class Bag

// bool insert(bag_typemember):

//   Precondition: it's not beyond the capacityof the bag

//   Postcondition: if insert successfully returntrue, otherwise false

//

// bool erase(bag_typemember):

//   Postcondition: if erase successfully returntrue, otherwise false

//

// int search(bag_typetarget):

//   Postcondition: if find return the index,otherwise NOT_FOUND(equal -1)

//

// CONST MEMBER METHOD forbag class (not const now)

// void travel():

//   Postcondition: travel the bag

//

// int count(bag_typetarget):

//   Postcondition: return how many times thetarget has been found, if

//   not found, return 0

 

 

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Diagnostics;

 

// Alias the data type withmy own type

using bag_size = System.UInt32;

using bag_type
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值