从vb转换为c Sharp. [英] Conversion from vb to c sharp.

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

问题描述

我是c Sharp的新开发人员.请告诉我如何将其转换为csharp.

I am a new developer of c sharp. please told me how i convert it into csharp.

Private Function DecryptPassWord(ByVal PassWord As String) As String
       Dim i As Integer
       Dim dcrpChar, dcrpString As String
       dcrpChar = ""
       dcrpString = ""
       For i = 1 To Len(PassWord)
           dcrpChar = 275 - Asc(Mid(PassWord, i, 1))
           dcrpString = Chr(dcrpChar) & dcrpString
       Next i
       DecryptPassWord = dcrpString
   End Function

推荐答案

有很多免费的转换器,很少有:
将C#转换为VB.NET [将C#转换为VB.NET2 [ .NET的代码转换 [将VB转换为C#或将C#转换为VB [
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!


要将C#代码转换为VB.Net或反之亦然,您可能需要以下工具.

语言转换.

语言转换是用于Visual Studio 2010和2012的简单插件,允许您将VB.net代码转换为C#和C#中的VB.net.

转换

FishCodeLib.com进行的转换是一个6合1的,集成的,功能强大的多功能转换和开发人员工具,也可以将C#代码转换为VB.Net,反之亦然.
Developerfusion转换器.

DeveloperFusion是一个基于Web的免费实用程序,可自动将C#转换为VB.NET中的等效代码,反之亦然,它允许您压缩和压缩整个项目并将其转换.

VB.Net到C#转换器. [
To convert C# code to VB.Net or vice versa, you may need the following tools.

Language Convert.

Language convert is a simple plug-in for Visual Studio 2010 and 2012 allows you to convert VB.net code to C# and VB.net in C#.

Convert

Convert by FishCodeLib.com is a (6-in-1) integrated, powerful, multi-purpose conversion and developer tool that can also convert C# code to VB.Net and vice versa.

Developerfusion converter.

DeveloperFusion is a free web based utility that automatically converts C# to its equivalent in VB.NET and vice-versa, it allows you zip and entire project and convert it.

VB.Net to C# converter.[^]

This a shareware(not free) desktop application. Their claim
VBconversions.com说:
VBconversions.com says:

最准确的VB.Net到C#转换器可以买到钱

The Most Accurate VB.Net to C# Converter Money Can Buy

感言. ;)


并以我自己"的方式来做吗?您可以从以下链接开始,CP也有一个,虽然有点旧.

VB.NET和C#的完全比较 [ ^ ]

一个Code项目文章,介绍了VB.NET和C#的优点,区别和新功能.最近更新时间. 2005年4月18日

C#和VB.Net的比较 [ wiki 文章,解释了C#和VB.Net之间的相似性,历史和差异.

Vb.Net和C#比较 [ GOOGLE. [^ ]

好吧,你还在吗?您在VB.Net中的代码

And they''ve got some testimonials too. ;)


And for a do it ''myself'' way? You can start from the following links, CP has one too, kinda old though.

Complete Comparison for VB.NET and C#[^]

A Code project article that explains about advantages, differences and new features of VB.NET and C#. Last Updated. 18 Apr 2005

Comparison For C# and VB.Net[^]

A wiki article that explains the similarities, history and differences between C# and VB.Net.

Vb.Net and C# comparison[^]

For further reading....

For more articles, try GOOGLE.[^]

Okay, are you still here? Your code in VB.Net

Private Function DecryptPassWord(ByVal PassWord As String) As String
       Dim i As Integer
       Dim dcrpChar, dcrpString As String
       dcrpChar = ""
       dcrpString = ""
       For i = 1 To Len(PassWord)
           dcrpChar = 275 - Asc(Mid(PassWord, i, 1))
           dcrpString = Chr(dcrpChar) & dcrpString
       Next i
       DecryptPassWord = dcrpString
   End Function



在C#中翻译为

...首先,在您的代码中,代码为Asc(Mid(PassWord, i, 1)).您应该知道函数Asc()和Mid()不可用,首先要做的是导入Microsoft.VisualBasic,因此,在using语句中,应添加



translates to in C# as

...First, in your code, the code Asc(Mid(PassWord, i, 1)). You should know that the functions Asc() and Mid() are not available, the first thing you should do is import Microsoft.VisualBasic so, in your using statements, you should add

using Microsoft.VisualBasic;

现在,您的代码将是....

Now, your code would be....

private string decryptpassword(string password)
{
  string dcrpChar, dcrpString;
  dcrpChar="";
  dcrpString="";
  for (int i=1; i<=password.Length(); i+=1)
  {
           dcrpChar = 275 - Asc(PassWord.Substring( i, 1));
           //For the line above, you could use.
           //dcrpChar = 275 - Microsoft.VisualBasic.Asc(PassWord.Substring(i, 1));
           dcrpString = (Char)dcrpChar + dcrpString;
   }
  return dcrpString;
}




这是指向网页的链接,您可以在其中将VB.NET转换为C#:
http://www.developerfusion.com/tools/convert/vb-to-csharp/ [ ^ ]
Hi,

Here''s a link to a webpage where you can convert VB.NET to C#:
http://www.developerfusion.com/tools/convert/vb-to-csharp/[^]


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

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