MessageCollection.Item Property (Int32)

 

Gets or sets the value of a Message at the specified zero-based index.

Namespace:   System.Web.Services.Description
Assembly:  System.Web.Services (in System.Web.Services.dll)

Public Property Item (
	index As Integer
) As Message

Parameters

index
Type: System.Int32

The zero-based index of the Message whose value is modified or returned.

Property Value

Type: System.Web.Services.Description.Message

A Message.

The following example demonstrates the use of a zero-based index to iterate through the members of a MessageCollection.

' Get Message Collection.
Dim myMessageCollection As MessageCollection = myServiceDescription.Messages
Console.WriteLine("Total Messages in the document = " + _
                        myServiceDescription.Messages.Count.ToString)
Console.WriteLine("")
Console.WriteLine("Enumerating Messages...")
Console.WriteLine("")
' Print messages to console.
Dim i As Integer
For i = 0 To myMessageCollection.Count - 1
   Console.WriteLine("Message Name : " + myMessageCollection(i).Name)
Next

.NET Framework
Available since 1.1
Return to top
Show: