VB.NET Question - Static, Shared, Confused

D

DaBrain

Thanks for any replies in advance.

I am C# Developer messing with VB.NET because I must move MANY
Functions on a web site that are written in inline HTML <SCRIPT and I
want to put them all in assemblies and call them.

However, so that I do not have to instantiate all of them all of the
time. I want them to be static methods/Functions

I read somewhere to use "Shared" that it was the same as Static but I
have since TOLD that shared does not behave like Static does -- and may
cause nightmare for me, but i have no clue.

more specifically I was told that if I used Shared Property, that one
User Session may Get confused with another session because this will
always holds the same memory locations. "This is the concept of shared"
- i was told. But this make no sense to me as HTTP is stateless
protocol, but who the hell knows at this point, I want to be sure.

1) What is the Truth? Is "shared" the VB Path to C# Static?
and/Or
2) Anyone Explain "Shared" - if it has a C# Equivalent, what is it?


Thank you all!
 
G

Guest

static =C# = Shared=VB.NET

they represent the same data to different users, so what you heard is correct.

Peter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,992
Messages
2,570,220
Members
46,807
Latest member
ryef

Latest Threads

Top