public static DataTable GetDataTable(int type, string i, string keyid) { string text = ""; DataTable result = null; switch (type) { case 0: text = AnyFunction.HttpGet("http://116.114.101.238:8883/data.aspx?action=group", ""); break; case 1: text = AnyFunction.HttpGet("http://116.114.101.238:8883/data.aspx?action=TER", ""); break; case 2: text = AnyFunction.HttpGet("http://116.114.101.238:8883/data.aspx?action=TRA&keyid=" + keyid + "&i=" + i, ""); break; } if (text.Length > 0) { result = JsonConvert.DeserializeObject <DataTable>(text); } return(result); }
static void Main(string[] args) { var s = "Fred"; //Hello(s); //InBetween(s); //Goodbye(s); AFunction af; //AFunction[] afarr = {Hello, InBetween, Goodbye}; //afarr.ToList().ForEach(x => x(s)); af = Hello; af += InBetween; af += Goodbye; af(s); af -= Hello; // dangerous af(s); AnyFunction anyf = Add; anyf += Multiply; anyf(3, 4); }