将用VB写的下面,变成C#的,100分

hiweiyi2000 2004-10-14 04:22:55
<Script Runat="Server">

Public Word As String

Sub Repeat( intNumTimes As Integer )
Dim intCounter As Integer
For intCounter = 0 to intNumTimes - 1
Response.Write( Word )
Next
End Sub

</Script>
...全文
56 点赞 收藏 7
写回复
7 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
yanyzty 2004-10-14
<Script Runat="Server">

public string Word;

void Repeat(int intNumTimes)
{
int intCounter;
for (intCounter = 0; intCounter < intNumTimes; i++)
{
Response.Write( Word );
}
}

</Script>
其实,vb。net和c#。net只是语法上的不同,用的都是。net框架,都是真正面向对象的新一代语言
回复
NekChan 2004-10-14
public string Word;

void Repeat(int intNumTimes)
{
int intCounter;
for (int intCounter=0; intCounter<intNumTimes; intCounter++)
{
Response.Write(Word);
}
回复
孟子E章 2004-10-14
public string Word;

void Repeat(int intNumTimes)
{
int intCounter;
for (int intCounter = 0; intCounter <= intNumTimes - 1; intCounter++) {
Response.Write(Word);
}



vb.NET 转c# 工具

http://www.developerfusion.com/utilities/convertvbtocsharp.aspx
回复
wangdequan1024 2004-10-14
<Script Runat="Server">

Public Word As String

public string Word;

void Repeat(int intNumTimes)
{
for (int i = 0; i< intNumTimes; i++)
{
Response.Write( Word );
}
}

</Script>

第二个
<%@ Register TagPrefix="SuperCompany" TagName="WordRepeater"
Src="WordRepeater.ascx" %>

<Script Runat="Server">

private void Page_Load
{
myWordRepeater.Repeat( 50 );
}

</Script>
回复
hiweiyi2000 2004-10-14
还有这个:

<%@ Register TagPrefix="SuperCompany" TagName="WordRepeater"
Src="WordRepeater.ascx" %>

<Script Runat="Server">

Sub Page_Load
myWordRepeater.Repeat( 50 )
End Sub

</Script>
回复
michaelowenii 2004-10-14
Sub Repeat( intNumTimes As Integer )
Dim intCounter As Integer
For intCounter = 0 to intNumTimes - 1
Response.Write( Word )
Next
End Sub

============================
void Repeat(int intNumTimes )
{
int intCounter ;

for(int i = 0 ; i <= intNumTimes - 1 ; i++)
{
Response.Write( "Word ")
}
}
回复
manbaum 2004-10-14
<Script Runat="Server">

public string Word;

void Repeat(int intNumTimes)
{
int intCounter;
for (intCounter = 0; intCounter < intNumTimes; i++)
{
Response.Write( Word );
}
}

</Script>
回复
相关推荐
发帖
.NET技术社区
创建于2007-09-28

5.8w+

社区成员

.NET技术交流专区
申请成为版主
帖子事件
创建了帖子
2004-10-14 04:22
社区公告
暂无公告