PDA

View Full Version : کاراکترهای Agent



sa_ghaznavi
شنبه 16 خرداد 1388, 11:42 صبح
چطور می تونم از کاراکترهای Agent در برنامه استفاده کنم . چه کدهایی بنویسم . البته نحوه استفاده در VB رو بلدم ولی وقتی از آن کدها در C# استفاده می کنم جواب نمیده.
لطفا راهنمایی کنید

yousefsystem
جمعه 14 بهمن 1390, 22:51 عصر
http://www.c-sharpcorner.com/UploadFile/ggaganesh/UsingMSAgentinCSharpPartITextToSpeech1123200500312 7AM/UsingMSAgentinCSharpPartITextToSpeech.aspx

به این لینک برو

yousefsystem
شنبه 15 بهمن 1390, 23:42 عصر
Step 1
Create a new Visual C# Project -- Windows Application
Step 2
Right click on Toolbox, select Customize Toolbox Option, select Microsoft Agent Control 2.0 from the Com Component List, click on Select button and press Ok button to add the control to your project.
Step 3
Drag Microsoft Agent Control from Toolbox and drop it in your project and also Place two buttons in your form to activate Speak and Think Methods of the Microsoft Agent Character.
Step 4
Declare a global AgentObjects.IAgentCtlCharacterEx type variable called genie with Public modifier
public AgentObjects.IAgentCtlCharacterEx genie;
Step 5
In the Form Load event, Write the following code to load genie character and assign the character to a variable called Genie.
axAgent1.Characters.Load("Genie","Genie.acs");
genie=axAgent1.Characters["Genie"];
Step 6
Write the following code in Button1 click event to trigger speak Method of Character.
genie.Show(false);
genie.Speak("Test Message","");
genie.Hide(true);
file:///C:/Users/YOUSEF%7E1/AppData/Local/Temp/msohtmlclip1/01/clip_image001.jpg
Step 7
Write the following code in Button2 click event to trigger Think Method of Character.
genie.Show(false);
genie.Think("Test Message");
genie.Hide(true);
file:///C:/Users/YOUSEF%7E1/AppData/Local/Temp/msohtmlclip1/01/clip_image002.jpg

You can also use Left and Top property of the character to set the position.