PDA

View Full Version : استفاده از listbox به جای فایل txt



saeedhushmand
یک شنبه 04 تیر 1391, 18:35 عصر
چه جوری می تونم در کد زیر به جای فایل txt از listbox استفاده کنم


Choices texts = new Choices();
string[] lines = File.ReadAllLines(Environment.CurrentDirectory + "\\action.txt");
foreach (string line in lines)
{
if (line.StartsWith("--") || line == String.Empty) continue;

var parts = line.Split(new char[] { '|' });

words.Add(new Word() { Text = parts[0], AttachedText = parts[1], IsShellCommand = (parts[2] == "true") });

texts.Add(parts[0]);
}
Grammar wordsList = new Grammar(new GrammarBuilder(texts));
speechRecognitionEngine.LoadGrammar(wordsList);

saman_h
یک شنبه 04 تیر 1391, 19:09 عصر
کاش یه توضیحی میدادی میخوای چیکار کنی شاید میتونستیم بهتر راهنماییت کنیم ...