janjuama84
asked on
Convertion from VB to C#
Can somebody please convert following code to C#?
''' <summary>
''' This page allows for classes to have seats deducted from it
''' </summary>
''' <remarks></remarks>
Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
' if first load then setup classes
If Not Page.IsPostBack Then
InitialiseClasses()
UpdateLabels()
End If
End Sub
''' <summary>
''' Initialises the Class Arrays based on parameters passed
''' </summary>
''' <param name="ClassSizes">The Size of the Classes</param>
''' <param name="AmountofClasses">The Amount of Classes to Create</param>
''' <remarks></remarks>
Private Sub InitialiseClasses(Optional ByVal ClassSizes As Integer = 15, Optional ByVal AmountofClasses As Integer = 3)
Dim TheClasses As New ArrayList()
Dim i As Integer
' For the Amount of Classes Specified
For i = 1 To AmountofClasses
' Add an integer of size ClassSizes to the ArrayList
TheClasses.Add(ClassSizes)
Next
' Add the Classes Arraylist to the Session
Session("Classes") = TheClasses
' Create an Arraylist of the size of ClassSizes and bind it to the Radio List
radSeatsAvailable.DataSour ce = PopulateArrayList(ClassSiz es)
radSeatsAvailable.DataBind ()
End Sub
''' <summary>
''' Creates and returns an array list of 1 to the specified size
''' </summary>
''' <param name="ArrayListLength">The Size of the ArrayList</param>
''' <returns>ArrayList of integers from 1 to ArrayListLength</returns>
''' <remarks></remarks>
Private Function PopulateArrayList(ByVal ArrayListLength As Integer) As ArrayList
Dim myarray As New ArrayList
Dim i As Integer
' For the size of the arraylist
For i = 1 To ArrayListLength
' Add an integer of the value i
myarray.Add(i)
Next
Return myarray
End Function
''' <summary>
''' Resets the radiolist when the dropdownlist with classes is changed
''' </summary>
''' <param name="sender"></param>
''' <param name="e"></param>
''' <remarks></remarks>
Protected Sub ddlClass_SelectedIndexChan ged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddlClass.SelectedIndexChan ged
' ReBind the radiolist based on the amount of seats left in the class
radSeatsAvailable.DataSour ce = PopulateArrayList(Session( "classes") .Item(ddlC lass.Selec tedIndex). ToString)
radSeatsAvailable.DataBind ()
UpdateLabels()
End Sub
''' <summary>
''' On Click update the amount of seats left in the class
''' </summary>
''' <param name="sender"></param>
''' <param name="e"></param>
''' <remarks></remarks>
Protected Sub btnRegister_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnRegister.Click
' Deduct the amount of seats based on the radio button selected
Session("classes").Item(dd lClass.Sel ectedIndex ) = Session("classes").Item(dd lClass.Sel ectedIndex ) - radSeatsAvailable.Selected Index - 1
' Bind the new amount of seats left
radSeatsAvailable.DataSour ce = PopulateArrayList(Session( "classes") .Item(ddlC lass.Selec tedIndex). ToString)
radSeatsAvailable.DataBind ()
UpdateLabels()
End Sub
''' <summary>
''' Updates the labels for user feedback
''' </summary>
''' <remarks></remarks>
Private Sub UpdateLabels()
lblClass1.Text = Session("classes").Item(0) .ToString
lblClass2.Text = Session("classes").Item(1) .ToString
lblClass3.Text = Session("classes").Item(2) .ToString
End Sub
End Class
''' <summary>
''' This page allows for classes to have seats deducted from it
''' </summary>
''' <remarks></remarks>
Partial Class _Default
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
' if first load then setup classes
If Not Page.IsPostBack Then
InitialiseClasses()
UpdateLabels()
End If
End Sub
''' <summary>
''' Initialises the Class Arrays based on parameters passed
''' </summary>
''' <param name="ClassSizes">The Size of the Classes</param>
''' <param name="AmountofClasses">The
''' <remarks></remarks>
Private Sub InitialiseClasses(Optional
Dim TheClasses As New ArrayList()
Dim i As Integer
' For the Amount of Classes Specified
For i = 1 To AmountofClasses
' Add an integer of size ClassSizes to the ArrayList
TheClasses.Add(ClassSizes)
Next
' Add the Classes Arraylist to the Session
Session("Classes") = TheClasses
' Create an Arraylist of the size of ClassSizes and bind it to the Radio List
radSeatsAvailable.DataSour
radSeatsAvailable.DataBind
End Sub
''' <summary>
''' Creates and returns an array list of 1 to the specified size
''' </summary>
''' <param name="ArrayListLength">The
''' <returns>ArrayList of integers from 1 to ArrayListLength</returns>
''' <remarks></remarks>
Private Function PopulateArrayList(ByVal ArrayListLength As Integer) As ArrayList
Dim myarray As New ArrayList
Dim i As Integer
' For the size of the arraylist
For i = 1 To ArrayListLength
' Add an integer of the value i
myarray.Add(i)
Next
Return myarray
End Function
''' <summary>
''' Resets the radiolist when the dropdownlist with classes is changed
''' </summary>
''' <param name="sender"></param>
''' <param name="e"></param>
''' <remarks></remarks>
Protected Sub ddlClass_SelectedIndexChan
' ReBind the radiolist based on the amount of seats left in the class
radSeatsAvailable.DataSour
radSeatsAvailable.DataBind
UpdateLabels()
End Sub
''' <summary>
''' On Click update the amount of seats left in the class
''' </summary>
''' <param name="sender"></param>
''' <param name="e"></param>
''' <remarks></remarks>
Protected Sub btnRegister_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnRegister.Click
' Deduct the amount of seats based on the radio button selected
Session("classes").Item(dd
' Bind the new amount of seats left
radSeatsAvailable.DataSour
radSeatsAvailable.DataBind
UpdateLabels()
End Sub
''' <summary>
''' Updates the labels for user feedback
''' </summary>
''' <remarks></remarks>
Private Sub UpdateLabels()
lblClass1.Text = Session("classes").Item(0)
lblClass2.Text = Session("classes").Item(1)
lblClass3.Text = Session("classes").Item(2)
End Sub
End Class
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
what to do with
// Warning!!! Optional parameters not supported
// Warning!!! Optional parameters not supported
how to convert those?
// Warning!!! Optional parameters not supported
// Warning!!! Optional parameters not supported
how to convert those?
Optional parameters are not supported in C#. TO get the same behavior, you need to create mutliple methods. For example.
if you have a sub in vb called dosomething with two parameters and one is optional, in c# you would do
public void dosomething(int MyParm1){
//your code
}
public void dosomething(int MyParm1, int MyParm2){
//your code to use when both paramters are needed.
}
if you have a sub in vb called dosomething with two parameters and one is optional, in c# you would do
public void dosomething(int MyParm1){
//your code
}
public void dosomething(int MyParm1, int MyParm2){
//your code to use when both paramters are needed.
}
ASKER
this line
Private Sub InitialiseClasses(Optional ByVal ClassSizes As Integer = 15, Optional ByVal AmountofClasses As Integer = 3)
is converted into this
private void InitialiseClasses(int ClassSizes, void =, void 15, int AmountofClasses, void =, void 3) {
doesn't look right
Private Sub InitialiseClasses(Optional
is converted into this
private void InitialiseClasses(int ClassSizes, void =, void 15, int AmountofClasses, void =, void 3) {
doesn't look right
ASKER
Can you help me convert this properly....
''' <summary>
''' Resets the radiolist when the dropdownlist with classes is changed
''' </summary>
''' <param name="sender"></param>
''' <param name="e"></param>
''' <remarks></remarks>
Protected Sub ddlClass_SelectedIndexChan ged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddlClass.SelectedIndexChan ged
' ReBind the radiolist based on the amount of seats left in the class
radSeatsAvailable.DataSour ce = PopulateArrayList(Session( "classes") .Item(ddlC lass.Selec tedIndex). ToString)
radSeatsAvailable.DataBind ()
UpdateLabels()
End Sub
''' <summary>
''' Resets the radiolist when the dropdownlist with classes is changed
''' </summary>
''' <param name="sender"></param>
''' <param name="e"></param>
''' <remarks></remarks>
Protected Sub ddlClass_SelectedIndexChan
' ReBind the radiolist based on the amount of seats left in the class
radSeatsAvailable.DataSour
radSeatsAvailable.DataBind
UpdateLabels()
End Sub
Automated tools can't do it all! Try just changing it to
private void InitialiseClasses(int ClassSizes, int AmountofClasses) {
private void InitialiseClasses(int ClassSizes, int AmountofClasses) {
/// <summary>
/// Resets the radiolist when the dropdownlist with classes is changed
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
/// <remarks></remarks>
protected void ddlClass_SelectedIndexChan ged(object sender, System.EventArgs e) {
// ReBind the radiolist based on the amount of seats left in the class
radSeatsAvailable.DataSour ce = PopulateArrayList(Session( "classes") .Item[ddlC lass.Selec tedIndex]. ToString);
radSeatsAvailable.DataBind ();
UpdateLabels();
}
/// Resets the radiolist when the dropdownlist with classes is changed
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
/// <remarks></remarks>
protected void ddlClass_SelectedIndexChan
// ReBind the radiolist based on the amount of seats left in the class
radSeatsAvailable.DataSour
radSeatsAvailable.DataBind
UpdateLabels();
}
In the IDE, highlight the ddlClass object and in the SelectedIndexChanged event, enter ddlClass_SelectedIndexChan ged as the handler. Or to manually do it, you could put this in your page load
ddlClass.SelectedIndexChan ged += ddlClass_SelectedIndexChan ged(object sender, System.EventArgs e);
ddlClass.SelectedIndexChan
ASKER
this is the code I have right now
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls. WebParts;
using System.Web.UI.HtmlControls ;
public partial class Labs_lab2 : System.Web.UI.Page
{
protected void Page_Load(object sender, System.EventArgs e) {
// if first load then setup classes
if (!Page.IsPostBack) {
InitialiseClasses();
UpdateLabels();
}
}
private void InitialiseClasses(int ClassSizes, int AmountofClasse) {
ClassSizes = 15;
AmountofClasse = 3;
ArrayList TheClasses = new ArrayList();
// Warning!!! Optional parameters not supported
// Warning!!! Optional parameters not supported
int i;
// For the Amount of Classes Specified
for (i = 1; (i <= AmountofClasses); i++) {
// Add an integer of size ClassSizes to the ArrayList
TheClasses.Add(ClassSizes) ;
}
// Add the Classes Arraylist to the Session
Session("Classes") = TheClasses;
// Create an Arraylist of the size of ClassSizes and bind it to the Radio List
radSeatsAvailable.DataSour ce = PopulateArrayList(ClassSiz es);
radSeatsAvailable.DataBind ();
}
private ArrayList PopulateArrayList(int ArrayListLength) {
ArrayList myarray = new ArrayList();
int i;
// For the size of the arraylist
for (i = 1; (i <= ArrayListLength); i++) {
// Add an integer of the value i
myarray.Add(i);
}
return myarray;
}
protected void ddlClass_SelectedIndexChan ged(object sender, System.EventArgs e) {
// ReBind the radiolist based on the amount of seats left in the class
radSeatsAvailable.DataSour ce = PopulateArrayList(Session( "classes") .Item[ddlC lass.Selec tedIndex]. ToString);
radSeatsAvailable.DataBind ();
UpdateLabels();
}
protected void btnPurchase_Click(object sender, System.EventArgs e) {
// Deduct the amount of seats based on the radio button selected
Session("classes").Item[dd lClass.Sel ectedIndex ] = (Session("classes").Item[d dlClass.Se lectedInde x]
- (radSeatsAvailable.Selecte dIndex - 1));
// Bind the new amount of seats left
radSeatsAvailable.DataSour ce = PopulateArrayList(Session( "classes") .Item[ddlC lass.Selec tedIndex]. ToString);
radSeatsAvailable.DataBind ();
UpdateLabels();
}
private void UpdateLabels() {
lblClass1.Text = Session("classes").Item[0] .ToString;
lblClass2.Text = Session("classes").Item[1] .ToString;
lblClass3.Text = Session("classes").Item[2] .ToString;
}
}
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.
using System.Web.UI.HtmlControls
public partial class Labs_lab2 : System.Web.UI.Page
{
protected void Page_Load(object sender, System.EventArgs e) {
// if first load then setup classes
if (!Page.IsPostBack) {
InitialiseClasses();
UpdateLabels();
}
}
private void InitialiseClasses(int ClassSizes, int AmountofClasse) {
ClassSizes = 15;
AmountofClasse = 3;
ArrayList TheClasses = new ArrayList();
// Warning!!! Optional parameters not supported
// Warning!!! Optional parameters not supported
int i;
// For the Amount of Classes Specified
for (i = 1; (i <= AmountofClasses); i++) {
// Add an integer of size ClassSizes to the ArrayList
TheClasses.Add(ClassSizes)
}
// Add the Classes Arraylist to the Session
Session("Classes") = TheClasses;
// Create an Arraylist of the size of ClassSizes and bind it to the Radio List
radSeatsAvailable.DataSour
radSeatsAvailable.DataBind
}
private ArrayList PopulateArrayList(int ArrayListLength) {
ArrayList myarray = new ArrayList();
int i;
// For the size of the arraylist
for (i = 1; (i <= ArrayListLength); i++) {
// Add an integer of the value i
myarray.Add(i);
}
return myarray;
}
protected void ddlClass_SelectedIndexChan
// ReBind the radiolist based on the amount of seats left in the class
radSeatsAvailable.DataSour
radSeatsAvailable.DataBind
UpdateLabels();
}
protected void btnPurchase_Click(object sender, System.EventArgs e) {
// Deduct the amount of seats based on the radio button selected
Session("classes").Item[dd
- (radSeatsAvailable.Selecte
// Bind the new amount of seats left
radSeatsAvailable.DataSour
radSeatsAvailable.DataBind
UpdateLabels();
}
private void UpdateLabels() {
lblClass1.Text = Session("classes").Item[0]
lblClass2.Text = Session("classes").Item[1]
lblClass3.Text = Session("classes").Item[2]
}
}
Are you getting errors?
ASKER
yes here is it
Compiler Error Message: CS1501: No overload for method 'InitialiseClasses' takes '0' arguments
Source Error:
Line 15: // if first load then setup classes
Line 16: if (!Page.IsPostBack) {
Line 17: InitialiseClasses();
Line 18: UpdateLabels();
Line 19: }
Compiler Error Message: CS1501: No overload for method 'InitialiseClasses' takes '0' arguments
Source Error:
Line 15: // if first load then setup classes
Line 16: if (!Page.IsPostBack) {
Line 17: InitialiseClasses();
Line 18: UpdateLabels();
Line 19: }
Ok....so your call to initialiseClasses was not using either of the optional paramters in VB, so you new method should be this. Replace your existing IntialiseClasses method with these 2 methods.
private void InitialiseClasses() {
ClassSizes = 15;
AmountofClasse = 3;
ArrayList TheClasses = new ArrayList();
// Warning!!! Optional parameters not supported
// Warning!!! Optional parameters not supported
int i;
// For the Amount of Classes Specified
for (i = 1; (i <= AmountofClasses); i++) {
// Add an integer of size ClassSizes to the ArrayList
TheClasses.Add(ClassSizes) ;
}
// Add the Classes Arraylist to the Session
Session("Classes") = TheClasses;
// Create an Arraylist of the size of ClassSizes and bind it to the Radio List
radSeatsAvailable.DataSour ce = PopulateArrayList(ClassSiz es);
radSeatsAvailable.DataBind ();
}
private void InitialiseClasses(int ClassSizes, int AmountofClasse) {
ArrayList TheClasses = new ArrayList();
int i;
// For the Amount of Classes Specified
for (i = 1; (i <= AmountofClasses); i++) {
// Add an integer of size ClassSizes to the ArrayList
TheClasses.Add(ClassSizes) ;
}
// Add the Classes Arraylist to the Session
Session("Classes") = TheClasses;
// Create an Arraylist of the size of ClassSizes and bind it to the Radio List
radSeatsAvailable.DataSour ce = PopulateArrayList(ClassSiz es);
radSeatsAvailable.DataBind ();
}
private void InitialiseClasses() {
ClassSizes = 15;
AmountofClasse = 3;
ArrayList TheClasses = new ArrayList();
// Warning!!! Optional parameters not supported
// Warning!!! Optional parameters not supported
int i;
// For the Amount of Classes Specified
for (i = 1; (i <= AmountofClasses); i++) {
// Add an integer of size ClassSizes to the ArrayList
TheClasses.Add(ClassSizes)
}
// Add the Classes Arraylist to the Session
Session("Classes") = TheClasses;
// Create an Arraylist of the size of ClassSizes and bind it to the Radio List
radSeatsAvailable.DataSour
radSeatsAvailable.DataBind
}
private void InitialiseClasses(int ClassSizes, int AmountofClasse) {
ArrayList TheClasses = new ArrayList();
int i;
// For the Amount of Classes Specified
for (i = 1; (i <= AmountofClasses); i++) {
// Add an integer of size ClassSizes to the ArrayList
TheClasses.Add(ClassSizes)
}
// Add the Classes Arraylist to the Session
Session("Classes") = TheClasses;
// Create an Arraylist of the size of ClassSizes and bind it to the Radio List
radSeatsAvailable.DataSour
radSeatsAvailable.DataBind
}
Or even better, with this....
private void InitialiseClasses() {
ClassSizes = 15;
AmountofClasse = 3;
InitialiseClasses(ClassSiz es, AmountofClasse);
}
private void InitialiseClasses(int ClassSizes, int AmountofClasse) {
ArrayList TheClasses = new ArrayList();
int i;
// For the Amount of Classes Specified
for (i = 1; (i <= AmountofClasses); i++) {
// Add an integer of size ClassSizes to the ArrayList
TheClasses.Add(ClassSizes) ;
}
// Add the Classes Arraylist to the Session
Session("Classes") = TheClasses;
// Create an Arraylist of the size of ClassSizes and bind it to the Radio List
radSeatsAvailable.DataSour ce = PopulateArrayList(ClassSiz es);
radSeatsAvailable.DataBind ();
}
private void InitialiseClasses() {
ClassSizes = 15;
AmountofClasse = 3;
InitialiseClasses(ClassSiz
}
private void InitialiseClasses(int ClassSizes, int AmountofClasse) {
ArrayList TheClasses = new ArrayList();
int i;
// For the Amount of Classes Specified
for (i = 1; (i <= AmountofClasses); i++) {
// Add an integer of size ClassSizes to the ArrayList
TheClasses.Add(ClassSizes)
}
// Add the Classes Arraylist to the Session
Session("Classes") = TheClasses;
// Create an Arraylist of the size of ClassSizes and bind it to the Radio List
radSeatsAvailable.DataSour
radSeatsAvailable.DataBind
}
ASKER
got this error now
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0118: 'System.Web.UI.Page.Sessio n' is a 'property' but is used like a 'method'
Source Error:
Line 40: }
Line 41: // Add the Classes Arraylist to the Session
Line 42: Session("Classes") = TheClasses;
Line 43: // Create an Arraylist of the size of ClassSizes and bind it to the Radio List
Line 44: radSeatsAvailable.DataSour ce = PopulateArrayList(ClassSiz es);
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0118: 'System.Web.UI.Page.Sessio
Source Error:
Line 40: }
Line 41: // Add the Classes Arraylist to the Session
Line 42: Session("Classes") = TheClasses;
Line 43: // Create an Arraylist of the size of ClassSizes and bind it to the Radio List
Line 44: radSeatsAvailable.DataSour
try
Session["Classes"] = TheClasses;
Session["Classes"] = TheClasses;
ASKER
that solved that issues here is another one
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0117: 'object' does not contain a definition for 'Item'
Source Error:
Line 61: protected void ddlClass_SelectedIndexChan ged(object sender, System.EventArgs e) {
Line 62: // ReBind the radiolist based on the amount of seats left in the class
Line 63: radSeatsAvailable.DataSour ce = PopulateArrayList(Session[ "classes"] .Item[ddlC lass.Selec tedIndex]. ToString);
Line 64: radSeatsAvailable.DataBind ();
Line 65: UpdateLabels();
Source File: C:\Inetpub\int422_071sq08\ webcontent \Labs\lab2 .aspx.cs Line: 63
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0117: 'object' does not contain a definition for 'Item'
Source Error:
Line 61: protected void ddlClass_SelectedIndexChan
Line 62: // ReBind the radiolist based on the amount of seats left in the class
Line 63: radSeatsAvailable.DataSour
Line 64: radSeatsAvailable.DataBind
Line 65: UpdateLabels();
Source File: C:\Inetpub\int422_071sq08\
In C# you need to type everything. objects in Session are object types. To access their members you need to explicitly convert them to what they are.
radSeatsAvailable.DataSour ce = PopulateArrayList(((ArrayL ist )Session["classes"]).Item[ ddlClass.S electedInd ex].ToStri ng);
radSeatsAvailable.DataSour
ASKER
its not helping me man... lots of error... not sure what to do
ASKER
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: CS0117: 'object' does not contain a definition for 'Item'
Source Error:
Line 61: protected void ddlClass_SelectedIndexChan ged(object sender, System.EventArgs e) {
Line 62: // ReBind the radiolist based on the amount of seats left in the class
Line 63: radSeatsAvailable.DataSour ce = PopulateArrayList(Session[ "classes"] .Item[ddlC lass.Selec tedIndex]. ToString);
Line 64: radSeatsAvailable.DataBind ();
Line 65: UpdateLabels();
Compiler Error Message: CS0117: 'object' does not contain a definition for 'Item'
Source Error:
Line 61: protected void ddlClass_SelectedIndexChan
Line 62: // ReBind the radiolist based on the amount of seats left in the class
Line 63: radSeatsAvailable.DataSour
Line 64: radSeatsAvailable.DataBind
Line 65: UpdateLabels();
This is the same exact error as above, you need to type Session["classes"] to an ArrayList
radSeatsAvailable.DataSour ce = PopulateArrayList(((ArrayL ist )Session["classes"]).Item[ ddlClass.S electedInd ex].ToStri ng);
or to make it easier to understand....
ArrayList x = (ArrayList) Session["classes"];
radSeatsAvailable.DataSour ce = PopulateArrayList(x.Item[d dlClass.Se lectedInde x].ToStrin g);
radSeatsAvailable.DataBind ();
UpdateLabels();
radSeatsAvailable.DataSour
or to make it easier to understand....
ArrayList x = (ArrayList) Session["classes"];
radSeatsAvailable.DataSour
radSeatsAvailable.DataBind
UpdateLabels();
ASKER
this one now
Line 26:
Line 27:
Line 28: private ArrayList PopulateArrayList(int ArrayListLength) {
Line 29: ArrayList myarray = new ArrayList();
Line 30: int i;
Line 26:
Line 27:
Line 28: private ArrayList PopulateArrayList(int ArrayListLength) {
Line 29: ArrayList myarray = new ArrayList();
Line 30: int i;
Try
System.Collections.ArrayLi st myarray = new System.Collections.ArrayLi st(ArrayLi stLength);
System.Collections.ArrayLi
http://www.carlosag.net/Tools/CodeTranslator/Default.aspx