在其他项目中使用类的静态方法

编程入门 行业动态 更新时间:2024-10-26 17:27:18
本文介绍了在其他项目中使用类的静态方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

朋友们, 我有一个用Visual Studio 2008编写的C#应用​​程序,它的解决方案包括几个项目.我已经在一个类的某个项目中编写了一个静态方法,并且希望在另一个项目(包含启动表单的项目)中访问此静态方法.请任何人提供任何形式的帮助.谢谢.

Hi friends, I have a C# application written in Visual Studio 2008 and it''s solution consist of several projects. I have written a static method in a class as part of one of the projects and will want to access this static method in another project(the project containing the startup form). Please any form of help from anyone is welcome. Thank you.

推荐答案

我在这里看不到任何问题,只需添加对包含该类的项目的引用,并使用静态方法,然后像这个: I don''t see any problem here, just add a reference to the project that contains the class with the static method and call your method like this: MyClass.MyStaticMethod()

更多推荐

在其他项目中使用类的静态方法

本文发布于:2023-07-16 16:08:59,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1123415.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:静态   方法   项目

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!