本文介绍了在其他项目中使用类的静态方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
朋友们, 我有一个用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()
更多推荐
在其他项目中使用类的静态方法
发布评论