【发布时间】:2010-11-09 14:03:57
【问题描述】:
可能重复:
VB.NET := Operator
昨天我在浏览Microsoft® Agent 代码 sn-ps 时看到 := 在调用函数时使用。
我尝试在 Google 中搜索它,但找不到任何相关内容。
是否因为调用了 COM 库的函数而使用了 :=?
代码:
Public Class Form1
Dim agent As AgentObjects.Agent
Dim merlin As AgentObjects.IAgentCtlCharacter
Private Sub Form1_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
agent.Characters.Unload("merlin")
merlin = Nothing
agent = Nothing
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
agent = New AgentObjects.Agent
agent.Connected = True
agent.Characters.Load(CharacterID:="Merlin", LoadKey:="merlin.acs")
merlin = agent.Characters(CharacterID:="Merlin")
agent.PropertySheet.Visible = True
End Sub
Public Sub IntroMerlin()
Dim strName As String
With merlin
'Display character.
.Show()
'Make the character play an animation.
.Play(Animation:="Greet")
.Play(Animation:="Restpose")
.Speak(Text:="Hello!")
.Play(Animation:="Announce")
.Speak(Text:="I am Merlin.")
.Play(Animation:="Pleased")
.Speak(Text:="It is nice to meet you.")
End With
End Sub
End Class
谢谢。
【问题讨论】:
-
@Georg Fritzsche 是的,它是 VB.NET := 运算符的副本,我尝试在 C# 中搜索 := 运算符而不是 Vb.net 中的 := 运算符。我真是太愚蠢了。甚至我也投票结束了这个问题。
-
你很诚实!我也会投票关闭。
标签: vb.net com microsoft-agent