在多个子中使用的变量 [英] Variables to use in more than one sub

查看:53
本文介绍了在多个子中使用的变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用ASP.net 1.1和VB.Net


有两个子程序使用相同变量的简单方法是什么(

中的59个) ?我不太了解OOP。我需要一种方法,使用很少的

概念,直到我掌握了这个过程。

Using ASP.net 1.1 and VB.Net

What is the SIMPLEST way to have 2 subroutines use the same variables (59 of
them)? I don''t know much about OOP. I need a way that uses very few
concepts until I get a grasp of the process.

推荐答案

如果2在同一个类中的子例程中,可以在该类中使用类范围变量

。如果他们在不同的课程中,您可以在所有课程都可以看到的模块中声明一个

变量


Sam


舞者 < da **** @ microsoft.comwrote in message

news:O3 **************** @ TK2MSFTNGP02.phx.gbl ...
If the 2 subroutines in the same class, you can use a class scope variable
with in that class. If they are in separate classes, you can declare a
variable in a module which is visible to all classes

Sam

"dancer" <da****@microsoft.comwrote in message
news:O3****************@TK2MSFTNGP02.phx.gbl...

使用ASP.net 1.1和VB.Net

什么是让子程序使用相同变量的SIMPLEST方法( 59

他们)?我不太了解OOP。我需要一种使用极少数

概念的方法,直到我掌握了这个过程。
Using ASP.net 1.1 and VB.Net

What is the SIMPLEST way to have 2 subroutines use the same variables (59
of them)? I don''t know much about OOP. I need a way that uses very few
concepts until I get a grasp of the process.



hi

,因为你在asp.net,我猜你正在编写的代码将是一个页面中的
。 asp.net中的每个页面都是一个类。如果你把你的变量

放在类声明中,所有的子程序都可以共享变量。

如果你在visual studio中,''class''定义在代码隐藏文件。

asp.net快速入门教程是学习asp.net的好方法。
http://samples.gotdotnet.com/quickstart/aspplus/

你需要了解OOP到擅长.net所以它会很好

值得您的时间。这是VB.Net OOP介绍的另一个链接:
http://www.codeproject.com/vb/net/OOPS_In_VBNET.asp

更多关于 http://www.google.com/search?q=vb.net%20OOP


希望这有帮助

tim

" dancer" < da **** @ microsoft.comwrote in message

news:O3 **************** @ TK2MSFTNGP02.phx.gbl ...
hi
since you are in asp.net, i am guessing that the code you are writing will
be in a page. Every page in asp.net is a class. if you put your variables
inside the class declaration, all the subroutines can share the variables.
if you are in visual studio, the ''class'' is defined in the code-behind file.
the asp.net quickstart tutorials are a great way to learn about asp.net.
http://samples.gotdotnet.com/quickstart/aspplus/
you will need to learn about OOP to get good at .net so it will be well
worth your time. here is another link to a VB.Net OOP introduction:
http://www.codeproject.com/vb/net/OOPS_In_VBNET.asp
plenty more on http://www.google.com/search?q=vb.net%20OOP

hope this helps
tim
"dancer" <da****@microsoft.comwrote in message
news:O3****************@TK2MSFTNGP02.phx.gbl...

使用ASP.net 1.1和VB.Net

什么是让子程序使用相同变量的SIMPLEST方法( 59

他们)?我不太了解OOP。在我掌握这个过程之前,我需要一种使用非常少的b $ b概念的方法。
Using ASP.net 1.1 and VB.Net

What is the SIMPLEST way to have 2 subroutines use the same variables (59
of them)? I don''t know much about OOP. I need a way that uses very few
concepts until I get a grasp of the process.


感谢您的回复。

我在这里看了 www.developerfusion.co.uk / vbnet / 288 / - 来自谷歌页面

你的建议。

我正在尝试教程。这很有道理。但后来我打了一个

的障碍。与其他人相同的障碍。

这是另一名学生提出的问题,但没有回答:


我印象非常深刻你的教程,因为它最终让我掌握了.net的OOP编程背后的

语法。

只有我不明白的是我如何以及在哪里编译.cs到一个

dll?我不能在服务器上这样做。我是否可以在我的本地计算机上执行此操作然后上传?



你知道这个问题的答案吗?我尝试从我的

命令提示符中执行此操作。我尝试从我的localhost做到这一点。没运气。我尝试将.cs代码直接放在我的aspx文件中。
。仍然没有运气。我是什么?缺少



Tim Mackey < ti ******** @ community.nospamwrote in message

news:B9 ********************** ************ @ microsof t.com ...
Thanks for replying.
I looked here www.developerfusion.co.uk/vbnet/288/ - from the google page
you suggested.
I was trying the tutorial. It was making a lot of sense. But then I hit a
snag. The same snag that somebody else hit.
This is a question posed by another student, but it was not answered:

"I am very impressed by your tutorial as it finally allowed me to grasp the
syntax behind OOP programming with .net.
Only what I did not understand is how and where do I complile the .cs to a
dll? I cannot do it on the server. Do I do it on my local computer and then
upload? "

Would you know the answer to this question? I tried doing it from my
command prompt. I tried doing it from my localhost. No luck. I tried
putting the .cs code directly in my aspx file. Still no luck. What am I
missing?


"Tim Mackey" <ti********@community.nospamwrote in message
news:B9**********************************@microsof t.com...



因为你在asp .net,我猜你正在编写的代码将是一个页面中的
。 asp.net中的每个页面都是一个类。如果你把

变量放在类声明中,所有子程序都可以共享

变量。如果你在visual studio中,''class''在

代码隐藏文件中定义。

asp.net快速入门教程是一个很好的学习方法关于asp.net。
http://samples.gotdotnet.com/快速启动/ aspplus /

您将需要了解OOP才能擅长.net所以它会很好

值得您花时间。这是VB.Net OOP介绍的另一个链接:
http://www.codeproject.com/vb/net/OOPS_In_VBNET.asp

更多关于 http://www.google.com/search?q=vb.net%20OOP


希望这有帮助

tim


" dancer" < da **** @ microsoft.comwrote in message

news:O3 **************** @ TK2MSFTNGP02.phx.gbl ...
hi
since you are in asp.net, i am guessing that the code you are writing will
be in a page. Every page in asp.net is a class. if you put your
variables inside the class declaration, all the subroutines can share the
variables. if you are in visual studio, the ''class'' is defined in the
code-behind file.
the asp.net quickstart tutorials are a great way to learn about asp.net.
http://samples.gotdotnet.com/quickstart/aspplus/
you will need to learn about OOP to get good at .net so it will be well
worth your time. here is another link to a VB.Net OOP introduction:
http://www.codeproject.com/vb/net/OOPS_In_VBNET.asp
plenty more on http://www.google.com/search?q=vb.net%20OOP

hope this helps
tim
"dancer" <da****@microsoft.comwrote in message
news:O3****************@TK2MSFTNGP02.phx.gbl...

>使用ASP.net 1.1和VB.Net


























他们)?我不太了解OOP。在我掌握这个过程之前,我需要一种使用极少概念的方法。
>Using ASP.net 1.1 and VB.Net

What is the SIMPLEST way to have 2 subroutines use the same variables (59
of them)? I don''t know much about OOP. I need a way that uses very few
concepts until I get a grasp of the process.



这篇关于在多个子中使用的变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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