找回密码
 立即注册

QQ登录

只需一步,快速开始

algerniat

注册会员

2

主题

8

帖子

104

积分

注册会员

积分
104

活字格认证

最新发帖
algerniat
注册会员   /  发表于:2010-3-30 22:27  /   查看:5558  /  回复:5
题目给的类代码是C#的,用VB如何填写代码呀?

5 个回复

倒序浏览
winking
葡萄城公司职员   /  发表于:2010-3-30 22:40:00
沙发
无论C#还是VB,编译出来都是.NET程序集,一样的实现,语法不一样而已。
比赛推荐使用C#

  1. public class The_Type_Name
  2. {
  3.    private DateTime dtBootTime;
  4.    public CS_Type()
  5.   {
  6.       //Constructor
  7.    }
  8.   //More sub or functions.
  9.    //...
  10. }
复制代码
这段C#对应VB:

  1. Public Class The_Type_Name
  2.   Private dtBootTime As New DateTime()
  3.   Public Sub New()
  4.     'Constructor
  5.   End Sub

  6.   ' More sub or functions.
  7.   '...
  8. End Class
复制代码
回复 使用道具 举报
algerniat
注册会员   /  发表于:2010-3-30 22:45:00
板凳

回复 2# winking 的帖子

谢谢!!
回复 使用道具 举报
gerry
论坛元老   /  发表于:2010-3-31 11:20:00
地板
注意下是VB.net 而非VB VB.net 和 VB相比可以用两个语言来形容。
回复 使用道具 举报
Valentine
版主   /  发表于:2010-3-31 12:17:00
5#
以下是IPlayer接口实现的VB.net例子
  1. Public Class PlayerDemo
  2.     Implements GrapeCity.Competition.Gomoku.Core.IPlayer


  3.     Public ReadOnly Property ID() As System.Guid Implements GrapeCity.Competition.Gomoku.Core.IPlayer.ID
  4.         Get
  5.             Return New Guid("{355D5552-E4EF-424b-96E7-CB4AE09293D8}")
  6.         End Get
  7.     End Property

  8.     Public ReadOnly Property Name() As String Implements GrapeCity.Competition.Gomoku.Core.IPlayer.Name
  9.         Get
  10.             Return "VB.net例子"
  11.         End Get
  12.     End Property

  13.     Public ReadOnly Property PlayStrategy() As GrapeCity.Competition.Gomoku.Core.IPlayStrategy Implements GrapeCity.Competition.Gomoku.Core.IPlayer.PlayStrategy
  14.         Get
  15.             ' TODO
  16.         End Get
  17.     End Property
  18. End Class
复制代码
回复 使用道具 举报
Valentine
版主   /  发表于:2010-3-31 12:19:00
6#
以下是IPlayStrategy接口实现的VB.net例子
  1. Public Class PlayStrateryDemo
  2.     Implements GrapeCity.Competition.Gomoku.Core.IPlayStrategy


  3.     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
  4.         ' TODO
  5.     End Function
  6. End Class
复制代码
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部