Click here to Skip to main content
15,881,089 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
unable to convert c# code to vb.net
C# Code
FixedPage page2= new FixedPage();
PageContent page2Content = new PageContent();
((IAddChild)page2Content).AddChild(page2);
Want to Convert in Vb.Net

dim fx as new FixedPage
dim cont as new PageContent
unable to convert line
((IAddChild)page2Content).AddChild(page2);
Into vb.net
Posted
Updated 26-Feb-13 18:59pm
v2

1 solution

Please, avoid the questions on the translation from VB.NET to C# or back, because this all can be done automatically.

You can use Reflector or its open-source replacement ILSpy or one of similar tools:
http://en.wikipedia.org/wiki/.NET_Reflector[^],
http://ilspy.net/[^].

Additionally, this is one of effective tools to learn CIL. It can be very useful, and I don't know a good reference on the language. CIL knowledge is very important, in particular, for using System.Reflection.Emit, an extremely powerful library.

You can write code in one language, compile it, load the assembly with ILSpy, choose another language, and decompile the code part you need. The accuracy of the results is very good.

This is a stand-along open-source code convertor: http://codeconvert.codeplex.com/[^].

There is a number of on-line tools:
http://www.developerfusion.com/tools/convert/vb-to-csharp/[^],
http://converter.telerik.com/[^].

You can find more: http://bit.ly/XFdX2G[^].

In some more complex cases, the accuracy can be questionable.

—SA
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900