123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- using QRCoder;
- using Core.RabbitMQBus.Common;
- using Core.RabbitMQBus.EventBus;
- using Core.RabbitMQBus.Extensions;
- using Microsoft.Extensions.DependencyInjection;
- namespace WindowsFormsApp1
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void button1_Click(object sender, EventArgs e)
- {
-
- RenderQrCode();
- }
- private void button2_Click(object sender, EventArgs e)
- {
-
-
-
-
-
-
-
-
-
-
-
-
-
- }
-
-
-
-
-
-
-
-
-
- private void RenderQrCode()
- {
- string level = "Q";
- QRCodeGenerator.ECCLevel eccLevel = (QRCodeGenerator.ECCLevel)(level == "L" ? 0 : level == "M" ? 1 : level == "Q" ? 2 : 3);
- using (QRCodeGenerator qrGenerator = new QRCodeGenerator())
- {
- using (QRCodeData qrCodeData = qrGenerator.CreateQrCode("9f3274ec-1481-4988-a3c8-698bbafbf14b", eccLevel))
- {
- using (QRCode qrCode = new QRCode(qrCodeData))
- {
- pictureBoxQRCode.BackgroundImage = qrCode.GetGraphic(20, Color.Black, Color.White,
- null, 50);
- this.pictureBoxQRCode.Size = new System.Drawing.Size(pictureBoxQRCode.Width, pictureBoxQRCode.Height);
-
- this.pictureBoxQRCode.SizeMode = PictureBoxSizeMode.CenterImage;
- pictureBoxQRCode.SizeMode = PictureBoxSizeMode.StretchImage;
- }
- }
- }
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- public static void Run()
- {
- List<Customers> customerlist = new List<Customers>();
- customerlist.Add(new Customers() { id = 1, Name = "Jack", Custom = "Mis" });
- customerlist.Add(new Customers() { id = 2, Name = "Lus", Custom = "Google" });
- customerlist.Add(new Customers() { id = 3, Name = "Qiao", Custom = "Baidu" });
- customerlist.Add(new Customers() { id = 4, Name = "Qiao", Custom = "Apple" });
- customerlist.Add(new Customers() { id = 5, Name = "Adb", Custom = "Adobe" });
-
- var customerQuery = from query in customerlist
- select query;
-
- var customerWhereQuery = from query in customerlist
- where query.id == 1 && query.Name == "Lus"
- select query;
-
- var customerOrderingQuery = from query in customerlist
- where query.Name == "Lus"
- orderby query.id ascending
- select query;
-
- var customerGroupbyQuery = from query in customerlist
- group query by query.Name;
-
- var customerGroupbyIntoQuery = from query in customerlist
- group query by query.Name into queryGroup
- where queryGroup.Key == "Qiao"
- select queryGroup;
- foreach (IGrouping<string, Customers> group in customerlist.GroupBy(c => c.Name))
- {
- Customers model = new Customers();
- model.Name = group.Key;
- foreach (Customers stu in group.OrderBy(a => a.Name))
- {
- Console.Write(stu.Name + ";");
- }
- var customerList = group.OrderBy(a => a.Name).ToList();
- }
-
- List<Customers> customerJoinlist = new List<Customers>();
- customerJoinlist.Add(new Customers() { id = 1, Name = "Jack", Custom = "Mis" });
- customerJoinlist.Add(new Customers() { id = 2, Name = "Lus", Custom = "Google" });
- customerJoinlist.Add(new Customers() { id = 3, Name = "Qiao", Custom = "Baidu" });
- var customerJoinQuery = from query1 in customerlist
- join query2 in customerJoinlist
- on query1.id equals query2.id
- select new { CustomerName = query1.Name, CustomerName2 = query2.Name };
-
-
-
- var customerTypeQuery = from query in customerlist
- where query.Name == "Lus"
- select query.Name;
-
- List<Customers> listString = customerlist.Where(s => s.Name == "Qiao").ToList();
- }
- }
- }
- public class Customers
- {
- public int id { get; set; }
- public string Name { get; set; }
- public string Custom { get; set; }
- }
- public interface ITestService
- {
- }
|