如何将vb.net代码转换为c#.net代码 [英] how to convert vb.net code into c# .net code

查看:73
本文介绍了如何将vb.net代码转换为c#.net代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所有人都好,

我想将VB .NET代码转换为C#.NET代码.I
在下面的行中得到错误,将其转换为C#.

Hai to all,

I want to convert the VB .NET code into C# .NET code.I
got the error in the below line to convert into C#.

If Page.IsPostBack = False Then
BindGrid()

推荐答案

您是否用过Google?这是谷歌给我的第一个链接:
http://www.developerfusion.com/tools/convert/vb-to-csharp/ [^ ]
这些转换器能够转换大多数VB.Net代码,但是在某些情况下根本无法实现,而您需要手动进行.

对于您的VB.NET代码,正确的C#代码为:
Have you googled? Here is the first link google gave to me:
http://www.developerfusion.com/tools/convert/vb-to-csharp/[^]
These converters are able to convert most of the VB.Net code, but there are some cases where it is simply not possible and you need to do it manually.

For your VB.NET code, the correct C# code would be:
if (!Page.IsPostBack)
  BindGrid();


我讨厌这个主意,但有时您可能需要它.一种转换工具在这里:
http://www.developerfusion.com/tools/convert/vb-to-csharp/ [ ^ ].

—SA
I hate the idea, but sometime you may need it. One conversion tool is here:
http://www.developerfusion.com/tools/convert/vb-to-csharp/[^].

—SA


作为先前答案的骑手:

请注意,尽管它们在转换方面非常擅长,但它们并非100%准确,因此您将需要手动检查重写的代码.
我保证,除了最简单的代码之外,其他任何东西都不会第一次运行.

但是,取决于复杂性以及您对代码的了解程度,这应该不会花费很长时间.
As a rider to the previous answers:

Be aware that although they are quite good at conversions, they are not 100% accurate, and you will need to go through manually checking the rewritten code.
I guarantee that anything other than the simplest code will not run first time.

However, dependant on complexity, and how well you know your code, this should not take a long time.


这篇关于如何将vb.net代码转换为c#.net代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆