/// <summary> /// 生成二维码 /// </summary> /// <param name="id"></param> /// <returns></returns> public ActionResult Cook(string id) { Cook cook = new Cook(); //必须先声明类型,默认是二维码 //cook.Type = Cook.CodeType.CODE39; //要的图片的大小(默认200*200) cook.Width = 200; cook.Height = 200; cook.Content = "http://localhost:49158/ReViewQRCode?Id=" + id; return(File(cook.GetStream(), "image/png")); }
/// <summary> /// 生成二维码 /// </summary> /// <param name="id"></param> /// <returns></returns> public ActionResult Cook(string id) { Cook cook = new Cook(); //必须先声明类型,默认是二维码 //cook.Type = Cook.CodeType.CODE39; //要的图片的大小(默认200*200) cook.Width = 200; cook.Height = 200; cook.Content = "http://xydx18.wcampaign.cn/Contents/Index/?Id=" + id; return(File(cook.GetStream(), "image/png")); }