尝试从VB.NET代码调用placeOrders函数。 我已经将betfair网站上的C#Library转换为VB.NET。
现在在调用方法的行上它返回错误而e.data什么都没有。
Friend Shared Sub testBetting()
Try
Dim placeInstructions As IList(Of PlaceInstruction) = New List(Of PlaceInstruction)()
Dim placeInstruction = New PlaceInstruction()
'get the first runner from the market
Dim runner = marketBook(0).Runners(0)
Dim selectionId = runner.SelectionId
placeInstruction.Handicap = 0
placeInstruction.Side = Side.BACK
placeInstruction.OrderType = OrderType.LIMIT
Dim limitOrder = New LimitOrder()
limitOrder.PersistenceType = PersistenceType.LAPSE
' place a back bet at rediculous odds so it doesn't get matched
limitOrder.Price = 3.5
limitOrder.Size = 0.05
' placing a bet below minimum stake, expecting a error in report
placeInstruction.LimitOrder = limitOrder
placeInstruction.SelectionId = selectionId
placeInstructions.Add(placeInstruction)
Dim customerRef = "785895438098" '"9876785895438098726178907895434" '"123456"
Dim placeExecutionReport = client.placeOrders(marketID, customerRef, placeInstructions)
Catch apiExcepion As BetfairLib.APINGException
MessageBox.Show("Got an exception from Api-NG: " + apiExcepion.ErrorCode)
End Try
End Sub