Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
I want to convert this code from c# to vb language in ASP.net.What is the expression of this code if I will write it to vb.
 
enter code here
`protected void btnPreview_Click(object sender, EventArgs e)
{
    Session["ImageBytes"] = PhotoUpload.FileBytes;
    ImagePreview.ImageUrl = "~/ImageHandler.ashx";
}`
Posted 18-Feb-13 6:16am
Edited 18-Feb-13 6:18am
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

There are lots of free converters, few are:
Convert C# to VB.NET [^]
Convert C# to VB.NET2[^]
Code Translation for .NET [^]
Convert VB to C# or C# to VB[^]
Try it yourself!
  Permalink  
Comments
Sergey Alexandrovich Kryukov at 18-Feb-13 14:16pm
   
Good (my 5), but it is all on the Web?
I strongly recommend open-source ILSpy, to be independent from all sites/services.
Please see my answer.
—SA
Farzanatayeb at 18-Feb-13 22:39pm
   
It works,thank you for your solution.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

ILSpy can be used as the open-source desktop code converter:
http://ilspy.net/[^].
 
The best thing is that you won't be dependent on any sites or services. This software has a lot more uses; this is an open-source replacement for the famous Reflector:
http://en.wikipedia.org/wiki/.NET_Reflector[^].
 
[EDIT]
 
This is how to use it for translation: having some C# code, compile it into any assembly. Load this assembly with ILSpy from a file (such as .DLL, .EXE…), locate the code you are interested in. For output language, select VB.NET. When you disassemble the code, it will be shown in VB.NET. Same thing to get C# from VB.NET.
 
—SA
  Permalink  
v2
Comments
Sandeep Mewara at 19-Feb-13 1:53am
   
Interesting. Thanks for sharing. Good to know about it. My 5!
 

My only doubt is if OP can use it by himself to do a VB <-> C#
Sergey Alexandrovich Kryukov at 19-Feb-13 1:56am
   
Thank you, Sandeep.
(By the way, you did not actually vote.)
It was Espen Harlinn who first advised this utility. I use it these days, built from source. Not bad at all.
—SA
Sandeep Mewara at 19-Feb-13 1:59am
   
A delayed 5 actually. You saw my comment instantly! :)
 
About tool, a thank you token is on the way to Espen too. :)
Sergey Alexandrovich Kryukov at 19-Feb-13 2:02am
   
Certainly.
Thank you, Sandeep.
—SA
Sergey Alexandrovich Kryukov at 19-Feb-13 2:01am
   
By the way, you are right: it's better to explain the usage. I just did it, after [EDIT].
And I recently found that ILSpy can be used as a decent debugger. Impressive, considering that you can do it without having source code. You can even attach to already executing process...
—SA
Sandeep Mewara at 19-Feb-13 2:10am
   
Thats good to know. I will try to have a look at it when I get some time, you have made it 'definitely use' category tool. :)
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Go here for a language converter:
 
Click[^]
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 410
1 Jochen Arndt 200
2 Richard MacCutchan 135
3 DamithSL 105
4 PIEBALDconsult 90
0 OriginalGriff 6,045
1 DamithSL 4,601
2 Maciej Los 4,032
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,220


Advertise | Privacy | Mobile
Web01 | 2.8.141220.1 | Last Updated 19 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100