Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old July 21st, 2008, 11:37 AM
Authorized User
 
Join Date: Jul 2008
Location: , , .
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default How To convert code

Hey all
I wanna know how to convert the VB code into C# code
Thank you

aliusmankhan
__________________
aliusmankhan
  #2 (permalink)  
Old July 21st, 2008, 12:56 PM
Friend of Wrox
 
Join Date: Nov 2004
Location: Port Orchard, WA, USA.
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts
Default

Line by line, take the actions that the VB makes happen, and create the same functionality in C#.

You can speed some of this by writing some rules in a Word macro, pasting the VB into Word, and running the macro against the "document."

For instance, you could turn all "End Sub" and "End Function" statements into "}"

You could look for specific signatures in the the procedure declaration, and replace them with C# equivalents. When you find ") As Integer" at the end of a line, add "int " to a string you are creating. If you find "Public Sub ", start with "void "

But as you can see, you essentially would have to "educate" Word about VB syntax and C# syntax.


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help me i must convert Code vb to C# pla_2 C# 3 October 14th, 2006 12:54 AM
Convert to C# Code sanjaymannnet ASP.NET 1.0 and 1.1 Basics 1 September 16th, 2006 10:47 AM
Convert C++ Code to C# skin C# 2 May 30th, 2006 05:34 AM
Convert VB to C# code skdp VS.NET 2002/2003 2 March 1st, 2004 11:45 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.