求教语言
题目给的类代码是C#的,用VB如何填写代码呀? 无论C#还是VB,编译出来都是.NET程序集,一样的实现,语法不一样而已。比赛推荐使用C#
public class The_Type_Name
{
private DateTime dtBootTime;
public CS_Type()
{
//Constructor
}
//More sub or functions.
//...
}
这段C#对应VB:
Public Class The_Type_Name
Private dtBootTime As New DateTime()
Public Sub New()
'Constructor
End Sub
' More sub or functions.
'...
End Class
回复 2# winking 的帖子
谢谢!! 注意下是VB.net 而非VB VB.net 和 VB相比可以用两个语言来形容。 以下是IPlayer接口实现的VB.net例子Public Class PlayerDemoImplements GrapeCity.Competition.Gomoku.Core.IPlayer
Public ReadOnly Property ID() As System.Guid Implements GrapeCity.Competition.Gomoku.Core.IPlayer.ID
Get
Return New Guid("{355D5552-E4EF-424b-96E7-CB4AE09293D8}")
End Get
End Property
Public ReadOnly Property Name() As String Implements GrapeCity.Competition.Gomoku.Core.IPlayer.Name
Get
Return "VB.net例子"
End Get
End Property
Public ReadOnly Property PlayStrategy() As GrapeCity.Competition.Gomoku.Core.IPlayStrategy Implements GrapeCity.Competition.Gomoku.Core.IPlayer.PlayStrategy
Get
' TODO
End Get
End Property
End Class 以下是IPlayStrategy接口实现的VB.net例子Public Class PlayStrateryDemo
Implements GrapeCity.Competition.Gomoku.Core.IPlayStrategy
Public Function GetNextStep(ByVal chessBoard As GrapeCity.Competition.Gomoku.Core.IChessBoard, ByVal pieceType As GrapeCity.Competition.Gomoku.Core.PieceTypeEnum, ByVal stepIndex As Integer, ByVal prevStep As GrapeCity.Competition.Gomoku.Core.PlayStep?) As GrapeCity.Competition.Gomoku.Core.ChessBoardPoint Implements GrapeCity.Competition.Gomoku.Core.IPlayStrategy.GetNextStep
' TODO
End Function
End Class
页:
[1]