下面一段程序怎样转为c#?

lemonhuang 2004-04-10 05:20:46
function valid(prestring)
Dim texts
Dim seed
Dim i,length
prestring = trim(preString)
length = len(preString)
seed = length
Randomize(length)
texts = ""
seed = int(95*rnd(-asc(mid(preString,i,1))-seed*asc(right(prestring,1)))+32)
texts = chr(seed)
texts = Replace(texts,"'","")
texts = Replace(texts,"""","")
valid = texts
end function
这是一段asp程序,用c#应该怎样写?请大侠指教
...全文
26 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
lemonhuang 2004-04-12
  • 打赏
  • 举报
回复
randomize(5)
x = rnd(-5)
我很想知道上面的asp程序在c#中应该怎么写?
lemonhuang 2004-04-12
  • 打赏
  • 举报
回复
up
lemonhuang 2004-04-10
  • 打赏
  • 举报
回复
这样是不正确的
网_风 2004-04-10
  • 打赏
  • 举报
回复
Random rnd=new Random();
seed = int(95*rnd.Next(-asc(mid(preString,i,1))-seed*asc(right(prestring,1)))+32);
lemonhuang 2004-04-10
  • 打赏
  • 举报
回复
我现在主要是Randomize(length),rnd()不知在c#中怎么写。
hychieftain 2004-04-10
  • 打赏
  • 举报
回复
http://expert.csdn.net/Expert/topic/1645/1645967.xml
sjzwinfor 2004-04-10
  • 打赏
  • 举报
回复
public string valid(string prestring)
{
string texts;
int seed,i,length;
prestring=trim(preString);
length=preString.length;
seed=length;
texts="";
seed = int(95*rnd(-asc(mid(preString,i,1))-seed*asc(right(prestring,1)))+32)
texts = seed.ToString();
texts = texts.Replace("'","");
texts = texts.Replace("""","");
return texts;


}

110,501

社区成员

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

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

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