?
Solved

things in vb.net

Posted on 2004-08-27
5
Medium Priority
?
217 Views
Last Modified: 2010-04-23
hi vb.net experts..
i've some questions in vb.ent because i am still fresh :
1-what does (imports system) mean ? when i should use it ?
2- what does(shared sub main()) mean ? what's difference between sub main() and shared sub main()?
3-what is difference between Private and Public ?
4-when i convert the file.vb to vb.exe can i run it anywhere without installing the dot net framework ?

0
Comment
Question by:rammaa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 11915901
(1)  Imports helps so you don't have to make full references to objects and methods:  System.Windows.Forms.Application.ExecutablePath

      You can use multiple imports:

      Imports System
      Imports System.Windows
      Imports System.Windows.Forms
      Imports System.Windows.Forms.Application

(2)  A shared function in a class doesn't require an instance of that class to perform that function (i.e. String.Format).  With Shared Sub Main, you have have a class as the only file in a project, and provide an entry point to the library.

(3)  Private, Public, and Friend are scope parameters for variables, properties, and methods.  It gives you the ability to show or hide details to a specific class.

(4) All .NET programs require the framework to run.

Bob
0
 

Author Comment

by:rammaa
ID: 11918941
Hi Bob..
* i still can't understand precisely the difference between the public ,private and friend ! when should i use each of them?
* what is the difference between sub main() and shared sub main() ?
* Finally Please correct if i was wrong wrong :
 If i made a vb.net application and converted it to exe file this program can't be executed into my friends pc unless they installed the dot net framework on thier machines!
0
 
LVL 96

Accepted Solution

by:
Bob Learned earned 1000 total points
ID: 11930326
(1)  Adjusting your scope - A look into variable scopes in .NET
http://www.andreavb.com/forum/news/viewtopic_3361.html

http://www.startvbdotnet.com/language/lang1.htm

(2) http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=158&lngWId=10
     Look for the explanation of Shared code

(3) The .NET framework, namely the CLR (Common Language Runtime), is required to run any VB.NET program:

Introduction to the Common Language Runtime in VB.NET
http://www.freevbcode.com/ShowCode.asp?ID=2027

Bob
0
 

Author Comment

by:rammaa
ID: 11974873
thanks Bob
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 11976098
You welcome:)

Bob
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question