如何分享.cs [英] How to share a .cs

查看:98
本文介绍了如何分享.cs的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写了一个clss,比如DM.cs,我把它保存在一个独立的目录中

就像c:\ Myytil


我有c:\ proj1中的一个新项目。


当我使用VS将现有的c:\ Myytild \ DM.cs添加到新项目时,VS

将DM.cs格式复制到c:\ Myytil

到c:\ proj1。


如何离开DM。 cs在独立目录中?

I have write a clss, say DM.cs, and I save it in a independent directory
like c:\MyUtil

I have a new project in c:\proj1.

When I use VS to add the existed c:\MyUtil\DM.cs to the new project, the VS
will copy DM.cs form c:\MyUtil
to c:\proj1.

How can I left the DM.cs in the independent directory ?

推荐答案

创建一个只包含DM.cs的类库。

然后,从你的应用程序,以及任何其他需要使用它的应用程序,

添加对它的引用。


HTH,

FOR

make a class library containing only DM.cs.
Then, from your application, and any other app that needs to use it,
add a reference to it.

HTH,
F.O.R.


将代码文件添加到项目时,请确保将其指定为

链接文件。所以在添加现有项目中对话框,在您选择

DM.cs文件后,选择打开按钮上的下拉箭头。按钮,然后选择

链接文件。该文件现在将出现在解决方案资源管理器中,在

相应的项目下,带有一个代码文件图标,看起来它上面有一个小的
快捷方式图像。


-

Tim Wilson

..Net Compact Framework MVP


" AD" < ad@wfes.tcc.edu.tw>在消息中写道

新闻:ez ************** @ TK2MSFTNGP10.phx.gbl ...
When you add the code file to the project make sure that you specify it as a
"link file". So in the "Add Existing Item" dialog, after you select the
DM.cs file, select the drop down arrow on the "Open" button and then select
"Link File". The file will now appear in the Solution Explorer, under the
appropriate project, with a code file icon that looks like it has a little
shortcut image over top of it.

--
Tim Wilson
..Net Compact Framework MVP

"ad" <ad@wfes.tcc.edu.tw> wrote in message
news:ez**************@TK2MSFTNGP10.phx.gbl...
我写了一个clss比如说DM.cs,我将它保存在一个独立的目录中如c:\ Myytil

我在c:\ proj1中有一个新项目。
VS将复制DM.cs表格c:\ Myytil
到c:\\ \\ proj1。

如何将DM.cs留在独立目录中?
I have write a clss, say DM.cs, and I save it in a independent directory
like c:\MyUtil

I have a new project in c:\proj1.

When I use VS to add the existed c:\MyUtil\DM.cs to the new project, the VS will copy DM.cs form c:\MyUtil
to c:\proj1.

How can I left the DM.cs in the independent directory ?



" ad" ; < ad@wfes.tcc.edu.tw>在消息中写道

新闻:ez ************** @ TK2MSFTNGP10.phx.gbl ...
"ad" <ad@wfes.tcc.edu.tw> wrote in message
news:ez**************@TK2MSFTNGP10.phx.gbl...
我写了一个clss比如说DM.cs,我将它保存在一个独立的目录中如c:\ Myytil

我在c:\ proj1中有一个新项目。
VS
将复制DM.cs表格c:\ Myytil
到c:\ proj1。

如何将DM.cs留在独立目录中?
I have write a clss, say DM.cs, and I save it in a independent directory
like c:\MyUtil

I have a new project in c:\proj1.

When I use VS to add the existed c:\MyUtil\DM.cs to the new project, the
VS
will copy DM.cs form c:\MyUtil
to c:\proj1.

How can I left the DM.cs in the independent directory ?




添加/现有项目 - 导航到DM.cs.不要点击打开按钮,但是

使用下拉菜单并选择链接。


SP



Add / Existing Item - navigate to DM.cs. Do not click on the Open button but
use the dropdown and choose Link.

SP


这篇关于如何分享.cs的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆