如何在页面上调用class1.cs类 [英] how to call class1.cs class on page

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

问题描述

我想知道如何调用class1.cs class

i want to know how to call class1.cs class

推荐答案

您需要在另一个类中创建该类的对象实例,然后才能访问所有公共方法.

如果要直接调用类的方法,则可以将这些方法设为static.
You need to create an object instance of the class in another class and then you have access to all the public methods.

If you want to call methods of a class directly, you can make those methods static.


没有调用类"这样的概念.您总是通过读取方法或属性来调用方法或属性,如果方法具有getter或setter的话,则分别为其赋值.除了. "class1.cs"不能为类.这看起来像一个C#文件名.它也不能被调用. :-)

这个问题根本没有道理.

我什至不知道有什么可以帮助您的,任何帮助是否有意义.您真的需要理解自己的话.

—SA
There is no such notion as "calling a class". You always call a method, or a property through reading it or assigning it a value if it has a getter or a setter, respectively. Besides. "class1.cs" cannot be a class. This looks like a C# file name. It also cannot be called. :-)

The question makes no sense at all.

I don''t even know what can help you and does any help make sense or not. You really need to understand your own words.

—SA


这篇关于如何在页面上调用class1.cs类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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