--------------怎样翻译成C#语句------------------

cainiao000 2005-04-01 05:15:44
dim Nd,i,pwd
pwd="xxxxx"
for i = 1 to len(pwd)
Nd = Nd + chrw(ascw(mid(pwd,i,1)) + ascw(right(cstr(i*i),i)))
next
...全文
184 16 打赏 收藏 转发到动态 举报
写回复
用AI写文章
16 条回复
切换为时间正序
请发表友善的回复…
发表回复
landlordh 2005-04-04
  • 打赏
  • 举报
回复
添加对Microsoft Visual Basic.NET Runtime的引用。

string Nd;
string pwd;
pwd = "xxxxx";
Nd="";
for (int i = 0; i <= pwd.Length-1 ; i++)
{
Nd += Microsoft.VisualBasic.Strings.ChrW(Microsoft.VisualBasic.Strings.AscW(pwd.Substring( i, 1)) + Microsoft.VisualBasic.Strings.AscW(System.Convert.ToString(i * i).PadRight( i)));
}
Console.WriteLine(Nd);
lvwaike 2005-04-04
  • 打赏
  • 举报
回复
string pwd="xxxxx";
string nd="";
for(int i=0;i<pwd.Length;i++)
{
nd+=pwd.ToString().mid(i,1)+i.ToString().Right(i*i,i);
}
lovelxj 2005-04-04
  • 打赏
  • 举报
回复
好可爱的 UP
cainiao000 2005-04-04
  • 打赏
  • 举报
回复
http://community.csdn.net/Expert/topic/3905/3905883.xml?temp=.6932184
cainiao000 2005-04-04
  • 打赏
  • 举报
回复
再顶啊 ......
cainiao000 2005-04-04
  • 打赏
  • 举报
回复
谢谢, landlordh() ,你真厉害~

谢谢各位
oyljerry 2005-04-01
  • 打赏
  • 举报
回复
先看什么功能,然后根据功能来实现吧
fgc5201314 2005-04-01
  • 打赏
  • 举报
回复
晕死..4.1也不要这样禺人吧????
gdami 2005-04-01
  • 打赏
  • 举报
回复
一看,好多人比我还水。 没得救了。

C#中没有 ascw,chrw,right,mid。

好多照搬的

我看你要把运行结果 搞出来。 看看就知道原理了。 然后再用C#编
fanpengk 2005-04-01
  • 打赏
  • 举报
回复
string pwd="xxxxx";
string nd="";
for(int i=0;i<pwd.Length;i++)
{
nd+=pwd.ToString().mid(i,1)+i.ToString().Right(i*i,i);
}

v192 2005-04-01
  • 打赏
  • 举报
回复
呵呵,我现在VB.Net和C#转换都借助反编译软件,把编译好的文件反编译输出需要的语言,哈哈。
chsfly 2005-04-01
  • 打赏
  • 举报
回复
string Nd,i,pwd;
pwd ="xxxxx";
for(int i=1; i<pwd.Length; i++)
{
Nd=Nd+...
}
jialiang 2005-04-01
  • 打赏
  • 举报
回复
string Nd,pwd;
int i;
pwd="xxxxx"
for (i = 1;i<=pwd.Length;i++)
Nd = Nd + chrw(ascw(pwd.Substring(i,1)) + ascw(right(Convert.ToString(i * i), i)));
pingnt 2005-04-01
  • 打赏
  • 举报
回复
仅供参考:
string pwd="xxxxx";
string nd="";
for(int i=0;i<pwd.ToString().Length;i++)
{
nd+=pwd.ToString().mid(i,1)+i.ToString().Right(i*i,i);
}
jonescheng 2005-04-01
  • 打赏
  • 举报
回复
楼上翻译的没有问题
就是pwd应该是string pwd
还有ascw这些都是VB中特有的。在C#中没有
menuvb 2005-04-01
  • 打赏
  • 举报
回复


我只是照你给你代码翻译,我也不知道能不能行的通
object Nd;
object i;
object pwd;
pwd = "xxxxx";
for (int i = 1; i <= len(pwd); i++) {
Nd = Nd + chrw(ascw(mid(pwd, i, 1)) + ascw(right(System.Convert.ToString(i * i), i)));
}

110,535

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧