Results 1 to 16 of 16

Thread: VB.Net and C# question (Translating?)

  1. #1

    Thread Starter
    Frenzied Member Tec-Nico's Avatar
    Join Date
    Jun 2002
    Location
    México
    Posts
    1,192

    VB.Net and C# question (Translating?)

    This might appear a silly question... But someone said "There is no sillier question than the one that is not asked"

    So here is my question: I was asked to develop an application in any other language that is not VB.Net nor VB 6, so if I develop it on VB.Net is there a tool or a way that it will be translated into C# so I get the source code of C# of what I programmed on VB.Net?

    Again, read it: "Is there a way to get my code from VB.Net translated into C#?"

    Thanks...
    We miss you, friend... Rest in Peace, we will take care of the rest of it.

    [vbcode]
    On Error Me.Fault = False
    [/vbcode]
    - Silence is the human way to share ignorance
    Tec-Nico

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    A tool ? I've not seen(I was interested too) that but there is one which translate C# into VB.NET code .

  3. #3
    Fanatic Member
    Join Date
    Sep 2002
    Posts
    518
    Probably a more popular application will be, Can I get IL code into LanguageX, and that's a matter of time I think.

  4. #4

    Thread Starter
    Frenzied Member Tec-Nico's Avatar
    Join Date
    Jun 2002
    Location
    México
    Posts
    1,192
    Well.. I heard that since Visual Studio .Net would work everything under C# so all what we developed was actually translated to C#, solving the problems of compatibility so I was wondering if anyone know how to access to this "code" or maybe I was told wrong...

    I would like to know... I heard it was one of the advantages of VS .Net that you could change of language just with an utility...
    We miss you, friend... Rest in Peace, we will take care of the rest of it.

    [vbcode]
    On Error Me.Fault = False
    [/vbcode]
    - Silence is the human way to share ignorance
    Tec-Nico

  5. #5
    Fanatic Member
    Join Date
    Sep 2002
    Posts
    518
    //I heard that since Visual Studio .Net would work everything under C# so all what we developed was actually translated to C#, ...

    That's not correct actually, all .NET application code is pre-compiled into MS Intermediate Language, or IL, a sort of Assembler-ish behind the language.

    Quoting from Applied Microsoft .NET Framework Programming for Visual Basic: A managed EXE contains a PE (portable executable) header, a .text section, a .idata section, a CLR (common language runtime) header, the IL (intermediate language) code, and Metadata. At execution time the .NET runtime environment compiles the IL and metadata into machine code specific to your operating system and CPU and then the program executes. (a lot more than this goes on really but this is the simple version of it, there are many discussions as to how the process exactly works)

    This means that embedded in your EXE files is the Intermediate Language code, which can relatively easily be translated into another language, like C# or VB .NET. I think it would be easier to write a translator from IL to Language X, rather than Language X to Language Y, although if you can do the first then you can do the second also (Language X -> IL -> Language Y).

  6. #6
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    You're talking about decompiling from IL to source language then . Search the Forum for "decompilation" to get the tool . I can't remember the name exactly .

  7. #7
    Hyperactive Member
    Join Date
    Feb 2002
    Posts
    261

    Re: VB.Net and C# question (Translating?)

    Originally posted by Tec-Nico
    This might appear a silly question... But someone said "There is no sillier question than the one that is not asked"

    So here is my question: I was asked to develop an application in any other language that is not VB.Net nor VB 6, so if I develop it on VB.Net is there a tool or a way that it will be translated into C# so I get the source code of C# of what I programmed on VB.Net?

    Again, read it: "Is there a way to get my code from VB.Net translated into C#?"

    Thanks...
    Why can't it be in VB.NET if it can be in C#?

    Oh, and the tool you're looking for is from www.remotesoft.com/salamander

    However, I've heard that apps developed in VS.NET 2003 (or maybe just the framework 1.1) cannot be decompiled back like this.

  8. #8
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    vs.net 2003 brings a free obfuscator, but if u dont use it apps can still be opened easily
    \m/\m/

  9. #9
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Originally posted by PT Exorcist
    vs.net 2003 brings a free obfuscator, but if u dont use it apps can still be opened easily
    Exactly . VS.NET2003 impressed me in this area .

  10. #10
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    although im not really into the obfuscation technic things, i think that in some times there *can* appear some dissamblers that can de-obfuscate some kind of obfuscation..who knows..
    \m/\m/

  11. #11

    Thread Starter
    Frenzied Member Tec-Nico's Avatar
    Join Date
    Jun 2002
    Location
    México
    Posts
    1,192
    Sorry guys, I lost Internet for the weekend...

    And I already began learning C# (It is incredible the amount of time you can have for doing that with no Internet)

    But I will check that tool, it is great to have it at hand. Oh, and by the way, the professor did not want us to do it on VB because I know how to build object applications (I have worked with that for a time now) and I am good using VB, since he saw me smile when he told us what the project was about he added "Oh, and no VB, for you, ok? I want another language but VB since it is not completely oriented to Objects" So he just made my life difficult when he said that... He gave us less than a week for the program and he still wants me to learn another language.. Go figures!

    Anyway, I am almost done learning... I just wish I knew how to use XML databases. I think I will learn that now.
    We miss you, friend... Rest in Peace, we will take care of the rest of it.

    [vbcode]
    On Error Me.Fault = False
    [/vbcode]
    - Silence is the human way to share ignorance
    Tec-Nico

  12. #12
    Fanatic Member
    Join Date
    Sep 2002
    Posts
    518
    Moving data from XML to dataset and back is frightfully easy, you just have to watch out for a couple of gotchas - default field values are changed from empty strings to DBNull when you go from dataset to XML schema, and when you select against criteria that has embedded single quotes you have to escape them out (search/replace them to two single quotes)

  13. #13
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Originally posted by PT Exorcist
    although im not really into the obfuscation technic things, i think that in some times there *can* appear some dissamblers that can de-obfuscate some kind of obfuscation..who knows..
    I agree somehow but at least your code in VS.NET2003 won't be hacked easily ....this is for you PT Exorcist ...

  14. #14
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    hmm now i really got it how they do that..it is very interesting
    \m/\m/

  15. #15
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    This is what you need exactly ! Check it out !!!

  16. #16
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    Hell, if you had any previous C or C++ experience, porting the VB code into C# is just a matter of sittin down and going through your code... really, its mostly a matter of small syntax changes.

    I'm actually developing a library in Vb.Net and plan to move most of it over to C# since that language has COMMENT tags which I find extremely useful. I've read about 2 hours worth of the Programming Windows with C# from MS press, and since I started porting a day ago, I've got almost 40 % of the code ported. I of course, developed the VB .Net code with Option Strict, so there have been no surprises really as yet.

    When it comes down to it, you might as well get the hang of C#, because many jobs will be looking for development abilities in both...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width