Can anyone explain me in VB i need to use Public Shared Sub so it can be accessed from another form.
But what this “Public” and “Shared” means?
- Who is public?
- With who is shared?
If it is public shared does this means some other software or “some hacker app” can easier have access to this sub and it’s values?
In VB.NET,
Sharedis equivalent tostaticin C# – meaning the member belongs to the class, not an instance of it. You might think that this member is ‘Shared’ among all instances, but this is not technically correct, even though VB.NET will resolve aSharedmember though an instance invocation.The following code illustrates how VB.Net allows you to access these:
Publicmeans any linking assembly can see and use this member.