C#和VB.net中的静态关键字 [英] Static Key word in C# and VB.net

查看:69
本文介绍了C#和VB.net中的静态关键字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,所有访客,
我已经在C#中创建了一个类.我声明一些变量,并在变量前面使用 Static 关键字.该变量将记住该类所有实例的值.我想在VB.net类中创建类似的内容,但是当我使用 Static 关键字时,它将给我一个错误,并将其从 Static 更改为昏暗.

有人可以帮我吗?

最好的问候.

Hi all visitors,
I have created a class in C#. I declare some variables and in front of the variable I use the Static keyword. The variable will remember the value across all instances of that class. I want to create something like this in a VB.net class, but when I use the Static keyword it will give me an error and let me change it from Static to Dim.

Can anybody help me?

Best Regards.

推荐答案

使用共享"并在此处阅读有关此内容的所有信息:
Use "Shared" and read all about it here: http://msdn.microsoft.com/en-us/library/ms973875.aspx#methodscope_topic7[^].

Best Regards,


这篇关于C#和VB.net中的静态关键字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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