Click here to Skip to main content
15,886,110 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Updated 18-Feb-13 5:18am
v2

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!
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 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 18-Feb-13 22:39pm    
It works,thank you for your solution.
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
 
Share this answer
 
v2
Comments
Sandeep Mewara 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 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 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 19-Feb-13 2:02am    
Certainly.
Thank you, Sandeep.
—SA
Sergey Alexandrovich Kryukov 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
Go here for a language converter:

Click[^]
 
Share this answer
 

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