H
Henry
Hi guys,
I want to write some global functions which can be called from
different asp.net page.
In Visual Basic, there is a global module which allow me to do that.
In Visual Basic .net, I have to create a class file to host these
functions.
And every time when I need to call these functions, I have to create a
object.
If I don't want to create a object every time, I need to make these
functions as shared.
However, is it true that shared function will store all local variable
in same place even when being called in multi-thread environment?
For example:
Public Class MyClass
Publich Shared Sub MySub
Dim a as integer
........
End Sub
End class
If MyClass.MySub is called by multi-thread, will it cause error
because there is only one copy of local variable "a"?
Second question: in asp.net is there any other way to implement global
function, without using OOP?
Thank you.
Henry
I want to write some global functions which can be called from
different asp.net page.
In Visual Basic, there is a global module which allow me to do that.
In Visual Basic .net, I have to create a class file to host these
functions.
And every time when I need to call these functions, I have to create a
object.
If I don't want to create a object every time, I need to make these
functions as shared.
However, is it true that shared function will store all local variable
in same place even when being called in multi-thread environment?
For example:
Public Class MyClass
Publich Shared Sub MySub
Dim a as integer
........
End Sub
End class
If MyClass.MySub is called by multi-thread, will it cause error
because there is only one copy of local variable "a"?
Second question: in asp.net is there any other way to implement global
function, without using OOP?
Thank you.
Henry