using System; using System.Collections.Generic; using System.Text; using System.Data; namespace Stone.DataService.Biz { public class Command { public string Cmd; public string[] Pars; public Command(DataSet dsCommand) { if (dsCommand == null || !dsCommand.Tables.Contains("Command") || dsCommand.Tables["Command"].Rows.Count == 0) throw new Exception("指令格式不正确!"); this.Cmd = dsCommand.Tables["Command"].Rows[0]["Cmd"].ToString().ToUpper(); // 指令 if (dsCommand.Tables["Command"].Rows[0]["Pars"].ToString().Trim() != null) { this.Pars = dsCommand.Tables["Command"].Rows[0]["Pars"].ToString().Trim().Split(';'); } } } }