private void Main_Load(object sender, EventArgs e) { string strMenu = string.Empty; //读取菜单文件 StreamUtil streamUtil = new StreamUtil(); strMenu = streamUtil.GetJsonText(@"Content\Menuconfig.json"); Imenu = Json.ToListEntity <MenuAttributecs>(strMenu); ToolStripMenuItem subItem; foreach (MenuAttributecs menu in Imenu) { subItem = AddContextMenu(menu.MenuName, menu.Menu_no, menuStrip1.Items, new MenuClickAction(menu.Menu_no, menu)); } //List<MenuAttributecs> Lmenu = Json.ToList<MenuAttributecs>(strMenu); }