Convert VB.Net to C# Question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi!

How can I convert the code below (VB.Net) to C#?

Dim c As New ArrayList
Return CType(c.ToArray(GetType(HistoryInfo)), HistoryInfo())

Where "HistoryInfo" is a common class.

Thanks,
Bruno.
 
Thanks Mick, it's exactly what I need.
PS.: Yes, there is array manipulation between the line.

Regards,
Bruno Rodrigues.

Mick Doherty said:
This link will usually work, but in this case it was slightly incorrect as
it missed the [].
http://www.developerfusion.com/utilities/convertvbtocsharp.aspx

ArrayList c = new ArrayList();
///
///I assume there's some manipulation of c happening here.
///
return ((HistoryInfo[])c.ToArray(typeof(HistoryInfo)));

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html


Bruno Rodrigues said:
Hi!

How can I convert the code below (VB.Net) to C#?

Dim c As New ArrayList
Return CType(c.ToArray(GetType(HistoryInfo)), HistoryInfo())

Where "HistoryInfo" is a common class.

Thanks,
Bruno.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top