Zamples, Inc. logo
 Home   Search   Solutions   My Zamples   FAQ   News   Contact 
Zamples ID:
Password:
   
0 anonymous users;
26 users logged in.

Live Samples
Live APIs

HTML or JSP Frag
Java Servlet Frag
HTML & Applet
Bash
C# (Mono)
C++ (gcc)
Groovy
Haskell (Hugs98)
J2SE 1.4 Class
J2SE 1.4 Fragment
J2SE 5.0 Class
J2SE 5.0 Fragment
J2SE 6.0 Class
J2SE 6.0 Fragment
Perl
Python
Ruby
 

VB.NET Sample Code

Zamples is proud to announce support for VB.NET code examples, powered by Mono.

Oops!

VisualBasic.NET under Mono is taking a sabattical. When Mainsoft and Ximian/Novell get something working, we'll re-activate the examples on this page.

Additional resources:

Hello Zamples

This is the famous "Hello World" program, written in VB.NET and brought to life by Zamples.

Sample output:

Hello Zamples!
1/3/05
2:01 PM
Hello Zamples
Purpose: The famous "Hello World" program, written in VB.NET and brought to life by Zamples.
Description: Modify the message from "Hello Zamples!" to something else and rerun the example.
Module Example
    Sub Main()
        System.Console.WriteLine("Hello Zamples!")
    End Sub
End Module
to add a new posting or reply to an existing posting.

Command Line Arguments

Counts and displays command line arguments.

Sample output:

5 arguments
0: Command
1: line
2: arguments
3: go
4: here
1/5/05
10:15 PM
Command Line Parameters Version 1
Purpose: Counts and displays command line arguments.
Description: The Imports statement allows us to write "Console.Writeline" instead of the longer "System.Console.Writeline". The Args parameter passed in to the Main module is an array containing the command line arguments. The For loop prints out each argument on a separate line, using & to concatenate strings together.
Imports System
Module Example
    Sub Main(ByVal Args() as String)
        Dim I = Args.Length
        Console.WriteLine(I & " arguments")
        Dim J As Integer
        For J = 0 to I-1
              Console.WriteLine(J & ": " & Args(J))
        Next
    End Sub
End Module
1/5/05
10:23 PM
Command Line Arguments Version 2
Purpose: This shows one way of detecting and displaying command line arguments.
Description: Modify the arguments and rerun the example.
Mono currently doesn't support multiple arguments in VB for System.Console.WriteLine() so you I also used String.Format().
Imports System

Public Class CommandLine
    Public Shared Sub Main(ByVal Args() As String)
        Console.WriteLine("Number of command line parameters = {0}", Args.Length)
        Dim I As Integer = 0
        For I = 0 To Args.Length - 1
            Console.WriteLine(String.Format("Arg({0}) = {1}", I, Args(I)))
        Next
    End Sub
End Class
to add a new posting or reply to an existing posting.

Add New Code Samples Here

If you have code samples that don't fit into any of the topics above which you would like to contribute, please put them here.  We'll sort them out into their own sections as appropriate later.

0 Quality Tested Examples 0 Problems & Suggestions 0 Closed Issues
to add a new posting or reply to an existing posting.