-
Jun 1st, 2022, 05:29 AM
#1
Thread Starter
Frenzied Member
[RESOLVED] Tools or methods for "converting C# code into VB.Net code"
I often need to convert some C# code into VB.Net code. Initially I performed my conversion through the website "codeconverter.icsharpcode.net", which has a conversion accuracy of 90%. But recently the site seems to be not working, every time I open the site, it always shows "Loading..." status. Also, it seems that github.com always fails to open.
I'd like to know if there are some other better tools or methods for "converting C# code into VB.Net code"? Thanks !
Last edited by SearchingDataOnly; Jun 1st, 2022 at 05:34 AM.
-
Jun 1st, 2022, 06:43 AM
#2
Re: Tools or methods for "converting C# code into VB.Net code"
Try the Tangible Software converters. You can download the free versions
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Jun 1st, 2022, 08:15 AM
#3
Re: Tools or methods for "converting C# code into VB.Net code"
This is the specific tool that .paul. is referring to:
https://www.tangiblesoftwaresolution...converter.html
-
Jun 1st, 2022, 10:52 AM
#4
Re: Tools or methods for "converting C# code into VB.Net code"
Tangible Software converters has various options that allow control of conversions under the option menu or gear button in it's toolbar.
-
Jun 1st, 2022, 01:13 PM
#5
Re: Tools or methods for "converting C# code into VB.Net code"
I personally use Telerik's online converter. I don't know if it's any better or worse than the others suggested here. I have seen it fail to convert certain types of code. I use it mainly to convert small functions between languages or when I'm unsure how to represent a piece of C# code in VB.Net or vice versa.
-
Jun 1st, 2022, 03:31 PM
#6
Re: Tools or methods for "converting C# code into VB.Net code"
Originally Posted by Niya
I use it... when I'm unsure how to represent a piece of C# code in VB.Net or vice versa.
That's the reason i use the (Tangible Software) Instant C# tool. My VB is much stronger than my C# abilities, and the converter does a fairly accurate job usually.
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Jun 2nd, 2022, 08:04 PM
#7
Thread Starter
Frenzied Member
Re: Tools or methods for "converting C# code into VB.Net code"
Originally Posted by Niya
I personally use Telerik's online converter. I don't know if it's any better or worse than the others suggested here. I have seen it fail to convert certain types of code. I use it mainly to convert small functions between languages or when I'm unsure how to represent a piece of C# code in VB.Net or vice versa.
"Telerik's online converter" doesn't seem to handle comments, blank lines and #if #else.
-
Jun 2nd, 2022, 08:05 PM
#8
Thread Starter
Frenzied Member
Re: Tools or methods for "converting C# code into VB.Net code"
Originally Posted by .paul.
Try the Tangible Software converters. You can download the free versions
Originally Posted by jmcilhinney
Originally Posted by kareninstructor
Tangible Software converters has various options that allow control of conversions under the option menu or gear button in it's toolbar.
Tangible (Instant VB) is awesome. Although the free version can only convert 100 lines of code, it basically meets my requirements. Thank you very much.
-
Jun 2nd, 2022, 08:11 PM
#9
Thread Starter
Frenzied Member
Re: Tools or methods for "converting C# code into VB.Net code"
I'm thinking about a question:
Can we use CodeDom and roslyn to write our own C# Code-Converter? Because I also sometimes need to convert some C# code to VB6 code.
-
Jun 2nd, 2022, 09:09 PM
#10
Re: Tools or methods for "converting C# code into VB.Net code"
Originally Posted by SearchingDataOnly
Can we use CodeDom and roslyn to write our own C# Code-Converter? Because I also sometimes need to convert some C# code to VB6 code.
I believe so. CodeDom for sure because it's the engine the WinForms designers uses to generate the actual code when you drag and drop controls onto a Form in a WinForms project. Roslyn, I'm not so sure about. I know it is used in source generators and it can do some very amazing things but I'm not entirely certain Roslyn has much if any VB.Net support. It's always mentioned with C# more than anything.
These technologies work with abstract syntax trees and expression trees at their heart so I would not be surprised if they could be used to create effective source converters.
You could probably strap your own conversion algorithms onto Roslyn to convert C# code to VB6 if you wanted. It would at least save you from having to think about ASTs since it deals with all that. All you have to do is walk the AST and generate your VB6 code so all your time can be spent figure out how to generate the code and not on parsing the C# into a proper AST.
Last edited by Niya; Jun 2nd, 2022 at 09:12 PM.
-
Jun 3rd, 2022, 07:29 AM
#11
Thread Starter
Frenzied Member
Re: [RESOLVED] Tools or methods for "converting C# code into VB.Net code"
What you said makes perfect sense. If I can get the JSON string of the AST of the C# code, I can use my Transpiler to convert the AST JSON string of the C# code into VB.NET and VB6 code.
So, now the question is how do I get the JSON string of the AST of the C# code. I don't know if VB6 can generate JSON string of AST of C# code via roslyn-APIs or .Net.dlls
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|