C#桌面应用制作计算器进阶版01

基于C#桌面应用制作计算器做出了少量改动,其主要改动为新增加了一个label控件,使其每一步运算结果由label2展示出来,而当点击“=”时,最终运算结果将由label1展示出来,此时label清空。

修改后运行效果

修改后全篇代码

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApp计算器
{
    public partial class Form1 : Form
    {
        string symbol, num1, num2,Num1,Num2;
        double rt;
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            label1.Text = null;
            label2.Text = null;
            num1=null;
            num2=null;
            symbol = null;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            if (label1.Text.Length == 0&&symbol==null)
            {
                label1.Text = null;
            }else if (label1.Text.Length == 0 && symbol != null)
            {
                label1.Text = symbol;
            }
            else
            {
                if (label1.Text == "+" || label1.Text == "-" || label1.Text == "×" || label1.Text == "÷")
                {
                    label1.Text = num1;
                    symbol = null;
                }
                else
                {
                    string del = label1.Text;
                    label1.Text = del.Substring(0, del.Length - 1);
                    label2.Text = label1.Text;
                    if (label2.Text.Length>0&& label1.Text.Length != 0)
                    {
                        num2 = label1.Text;
                        if (symbol == "+")
                        {
                            rt = double.Parse(num1) + double.Parse(num2);
                            label2.Text = rt.ToString();
                        }
                        else if (symbol == "-")
                        {
                            rt = double.Parse(num1) - double.Parse(num2);
                            label2.Text = rt.ToString();
                        }
                        else if (symbol == "×")
                        {
                            rt = double.Parse(num1) * double.Parse(num2);
                            label2.Text = rt.ToString();
                        }
                        else if (symbol == "÷")
                        {
                            rt = double.Parse(num1) / double.Parse(num2);
                            label2.Text = rt.ToString();
                        }
                    }
                    else
                    {
                        if (label1.Text.Length <= 1 && symbol == null)
                        {
                            label2.Text=null;
                        }
                        else
                        {
                            label2.Text = num1;
                        }
                    }
                    if (label1.Text.Length < 30)
                    {
                        if (label1.Text.Length > 16)
                        {
                            label1.Font = new Font(label1.Font.FontFamily, 13f, label1.Font.Style);
                        }
                        else
                        {
                            label1.Font = new Font(label1.Font.FontFamily, 26f, label1.Font.Style);
                        }
                    }
                }
            }
        }

        private void button3_Click(object sender, EventArgs e)
        {
            if (label1.Text.Length == 0)
            {
                MessageBox.Show("error");
            }
            else if (label1.Text == "+" || label1.Text == "-" || label1.Text == "×" || label1.Text == "÷")
            {
                MessageBox.Show("error");
            }
            else
            {
                double reserve = double.Parse(label1.Text);
                reserve = -reserve;
                label1.Text = reserve.ToString();
                if (num1 != null && symbol != null)
                {
                    num2 = reserve.ToString();
                    if (symbol == "+")
                    {
                        rt = double.Parse(num1) + double.Parse(num2);
                        label2.Text = rt.ToString();
                    }
                    else if (symbol == "-")
                    {
                        rt = double.Parse(num1) - double.Parse(num2);
                        label2.Text = rt.ToString();
                    }
                    else if (symbol == "×")
                    {
                        rt = double.Parse(num1) * double.Parse(num2);
                        label2.Text = rt.ToString();
                    }
                    else if (symbol == "÷")
                    {
                        rt = double.Parse(num1) / double.Parse(num2);
                        label2.Text = rt.ToString();
                    }
                }
            }
        }

        private void button4_Click(object sender, EventArgs e)
        {
            string divide = "÷";
            if (symbol == null && label1.Text.Length<1&&num1==null)
            {
                MessageBox.Show("无运算数字");
            }
            else
            {
                if (symbol == null)
                {
                    if(num1 == null)
                    {
                        num1 = label1.Text;
                    }
                    symbol = divide;
                    label1.Text = symbol;
                    label2.Text = num1;
                }
                else
                {
                        if (label1.Text == "+" || label1.Text == "-" || label1.Text == "×" || label1.Text == "÷") {
                            MessageBox.Show("您已输入运算符");
                        }
                    else
                    {
                        num2 = label1.Text;
                        num1 = rt.ToString();
                        symbol = divide;
                        label1.Text = symbol;
                        label2.Text = rt.ToString();
                        num2 = null;
                    }
                }
            }
        }

        private void button8_Click(object sender, EventArgs e)
        {
            string seven = "7";
            if (label1.Text.Length < 30)
            {
                if (label1.Text == "+" || label1.Text == "-" || label1.Text == "×" || label1.Text == "÷")
                {
                    label1.Text = null;//如果前面有运算符,则先消除运算符再把数字投射到屏幕上
                }
                label1.Text = label1.Text + seven;//将数字投射到屏幕上
                if (label1.Text.Length > 16)
                {
                    label1.Font = new Font(label1.Font.FontFamily, 13f, label1.Font.Style);
                }
                else
                {
                    label1.Font = new Font(label1.Font.FontFamily, 26f, label1.Font.Style);
                }
            }
            else
            {
                MessageBox.Show("字符长度超出范围");
            }
            if(num1!=null&&symbol!=null)
            {
                num2 = label1.Text;
                if (symbol == "+")
                {
                    rt = double.Parse(num1) + double.Parse(num2);
                    label2.Text = rt.ToString();
                }
                else if (symbol == "-")
                {
                    rt = double.Parse(num1) - double.Parse(num2);
                    label2.Text = rt.ToString();
                }
                else if (symbol == "×")
                {
                    rt = double.Parse(num1) * double.Parse(num2);
                    label2.Text = rt.ToString();
                }
                else if (symbol == "÷")
                {
                    rt = double.Parse(num1) / double.Parse(num2);
                    label2.Text = rt.ToString();
                }
            }
        }

        private void button7_Click(object sender, EventArgs e)
        {
            string eight = "8";
            if (label1.Text.Length < 30)
            {
                if (label1.Text == "+" || label1.Text == "-" || label1.Text == "×" || label1.Text == "÷")
                {
                    label1.Text = null;
                }
                label1.Text = label1.Text + eight;
                if (label1.Text.Length > 16)
                {
                    label1.Font = new Font(label1.Font.FontFamily, 13f, label1.Font.Style);
                }
                else
                {
                    label1.Font = new Font(label1.Font.FontFamily, 26f, label1.Font.Style);
                }
            }
            else
            {
                MessageBox.Show("字符长度超出范围");
            }
            if (num1 != null && symbol != null)
            {
                num2 = label1.Text;
                if (symbol == "+")
                {
                    rt = double.Parse(num1) + double.Parse(num2);
                    label2.Text = rt.ToString();
                }
                else if (symbol == "-")
                {
                    rt = double.Parse(num1) - double.Parse(num2);
                    label2.Text = rt.ToString();
                }
                else if (symbol == "×")
                {
                    rt = double.Parse(num1) * double.Parse(num2);
                    label2.Text = rt.ToString();
                }
                else if (symbol == "÷")
                {
                    rt = double.Parse(num1) / double.Parse(num2);
                    label2.Text = rt.ToString();
                }
            }
        }

        private void button6_Click(object sender, EventArgs e)
        {
            string nine = "9";
            if (label1.Text.Length < 30)
            {
                if (label1.Text == "+" || label1.Text == "-" || label1.Text == "×" || label1.Text == "÷")
                {
                    label1.Text = null;
                }
                label1.Text = label1.Text + nine;
                if (label1.Text.Length > 16)
                {
                    label1.Font = new Font(label1.Font.FontFamily, 13f, label1.Font.Style);
                }
                else
                {
                    label1.Font = new Font(label1.Font.FontFamily, 26f, label1.Font.Style);
                }
            }
            else
            {
                MessageBox.Show("字符长度超出范围");
            }
            if (num1 != null && symbol != null)
            {
                num2 = label1.Text;
                if (symbol == "+")
                {
                    rt = double.Parse(num1) + double.Parse(num2);
                    label2.Text = rt.ToString();
                }
                else if (symbol == "-")
                {
                    rt = double.Parse(num1) - double.Parse(num2);
                    label2.Text = rt.ToString();
                }
                else if (symbol == "×")
                {
                    rt = double.Parse(num1) * double.Parse(num2);
                    label2.Text = rt.ToString();
                }
                else if (symbol == "÷")
                {
                    rt = double.Parse(num1) / double.Parse(num2);
                    label2.Text = rt.ToString();
                }
            }
        }

        private void button5_Click(object sender, EventArgs e)
        {
            string multiply = "×";
            if (symbol == null && label1.Text.Length < 1 && num1 == null)
            {
                MessageBox.Show("无运算数字");
            }
            else
            {
                if (symbol == null)
                {
                    if (num1 == null)
                    {
                        num1 = label1.Text;
                    }
                    symbol = multiply;
                    label1.Text = symbol;
                    label2.Text = num1;
                }
                else
                {
                    if (label1.Text == "+" || label1.Text == "-" || label1.Text == "×" || label1.Text == "÷")
                    {
                        MessageBox.Show("您已输入运算符");
                    }
                    else
                    {
                        num2 = label1.Text;
                        num1 = rt.ToString();
                        symbol = multiply;
                        label1.Text = symbol;
                        label2.Text = rt.ToString();
                        num2 = null;
                    }
                }
            }
        }

        private void button12_Click(object sender, EventArgs e)
        {
            string four = "4";
            if (label1.Text.Length < 30)
            {
                if (label1.Text == "+" || label1.Text == "-" || label1.Text == "×" || label1.Text == "÷")
                {
                    label1.Text = null;
                }
                label1.Text = label1.Text + four;
                if (label1.Text.Length > 16)
                {
                    label1.Font = new Font(label1.Font.FontFamily, 13f, label1.Font.Style);
                }
                else
                {
                    label1.Font = new Font(label1.Font.FontFamily, 26f, label1.Font.Style);
                }
            }
            else
            {
                MessageBox.Show("字符长度超出范围");
            }
            if (num1 != null && symbol != null)
            {
                num2 = label1.Text;
                if (symbol == "+")
                {
                    rt = double.Parse(num1) + double.Parse(num2);
                    label2.Text = rt.ToString();
                }
                else if (symbol == "-")
                {
                    rt = double.Parse(num1) - double.Parse(num2);
                    label2.Text = rt.ToString();
                }
                else if (symbol == "×")
                {
                    rt = double.Parse(num1) * double.Parse(num2);
                    label2.Text = rt.ToString();
                }
                else if (symbol == "÷")
                {
                    rt = double.Parse(num1) / double.Parse(num2);
                    label2.Text = rt.ToString();
                }
            }
        }

        private void button11_Click(object sender, EventArgs e)
        {
            string five = "5";
            if (label1.Text.Length < 30)
            {
                if (label1.Text == "+" || label1.Text == "-" || label1.Text == "×" || label1.Text == "÷")
                {
                    label1.Text = null;
                }
                label1.Text = label1.Text + five;
                if (label1.Text.Length > 16)
                {
                    label1.Font = new Font(label1.Font.FontFamily, 13f, label1.Font.Style);
                }
                else
                {
                    label1.Font = new Font(label1.Font.FontFamily, 26f, label1.Font.Style);
                }
            }
            else
            {
                MessageBox.Show("字符长度超出范围");
            }
            if (num1 != null && symbol != null)
            {
                num2 = label1.Text;
                if (symbol == "+")
                {
                    rt = double.Parse(num1) + double.Parse(num2);
                    label2.Text = rt.ToString();
                }
                else if (symbol == "-")
                {
                    rt = double.Parse(num1) - double.Parse(num2);
                    label2.Text = rt.ToString();
                }
                else if (symbol == "×")
                {
                    rt = double.Parse(num1) * double.Parse(num2);
                    label2.Text = rt.ToString();
                }
                else if (symbol == "÷")
                {
                    rt = double.Parse(num1) / double.Parse(num2);
                    label2.Text = rt.ToString();
                }
            }
        }

        private void button10_Click(object sender, EventArgs e)
        {
            string six = "6";
            if (label1.Text.Length < 30)
            {
                if (label1.Text == "+" || label1.Text == "-" || label1.Text == "×" || label1.Text == "÷")
                {
                    label1.Text = null;
                }
                label1.Text = label1.Text + six;
                if (label1.Text.Length > 16)
                {
                    label1.Font = new Font(label1.Font.FontFamily, 13f, label1.Font.Style);
                }
                else
                {
                    label1.Font = new Font(label1.Font.FontFamily, 26f, label1.Font.Style);
                }
            }
            else
            {
                MessageBox.Show("字符长度超出范围");
            }
            if (num1 != null && symbol != null)
            {
                num2 = label1.Text;
                if (symbol == "+")
                {
                    rt = double.Parse(num1) + double.Parse(num2);
                    label2.Text = rt.ToString();
                }
                else if (symbol == "-")
                {
                    rt = double.Parse(num1) - double.Parse(num2);
                    label2.Text = rt.ToString();
                }
                else if (symbol == "×")
                {
                    rt = double.Parse(num1) * double.Parse(num2);
                    label2.Text = rt.ToString();
                }
                else if (symbol == "÷")
                {
                    rt = double.Parse(num1) / double.Parse(num2);
                    label2.Text = rt.ToString();
                }
            }
        }

        private void button9_Click(object sender, EventArgs e)
        {
            string subtract = "-";
            if (symbol == null && label1.Text.Length < 1 && num1 == null)
            {
                MessageBox.Show("无运算数字");
            }
            else
            {
                if (symbol == null)
                {
                    if (num1 == null)
                    {
                        num1 = label1.Text;
                    }
                    symbol = subtract;
                    label1.Text = symbol;
                    label2.Text = num1;
                }
                else
                {
                    if (label1.Text == "+" || label1.Text == "-" || label1.Text == "×" || label1.Text == "÷")
                    {
                        MessageBox.Show("您已输入运算符");
                    }
                    else
                    {
                        num2 = label1.Text;
                        num1 = rt.ToString();
                        symbol = subtract;
                        label1.Text = symbol;
                        label2.Text = rt.ToString();
                        num2 = null;
                    }
                }
            }
        }

        private void button16_Click(object sender, EventArgs e)
        {
            string one = "1";
            if (label1.Text.Length < 30)
            {
                if (label1.Text == "+" || label1.Text == "-" || label1.Text == "×" || label1.Text == "÷")
                {
                    label1.Text = null;
                }
                label1.Text = label1.Text + one;
                if (label1.Text.Length > 16)
                {
                    label1.Font = new Font(label1.Font.FontFamily, 13f, label1.Font.Style);
                }
                else
                {
                    label1.Font = new Font(label1.Font.FontFamily, 26f, label1.Font.Style);
                }
            }
            else
            {
                MessageBox.Show("字符长度超出范围");
            }
            if (num1 != null && symbol != null)
            {
                num2 = label1.Text;
                if (symbol == "+")
                {
                    rt = double.Parse(num1) + double.Parse(num2);
                    label2.Text = rt.ToString();
                }
                else if (symbol == "-")
                {
                    rt = double.Parse(num1) - double.Parse(num2);
                    label2.Text = rt.ToString();
                }
                else if (symbol == "×")
                {
                    rt = double.Parse(num1) * double.Parse(num2);
                    label2.Text = rt.ToString();
                }
                else if (symbol == "÷")
                {
                    rt = double.Parse(num1) / double.Parse(num2);
                    label2.Text = rt.ToString();
                }
            }
        }

        private void button15_Click(object sender, EventArgs e)
        {
            string two = "2";
            if (label1.Text.Length < 30)
            {
                if (label1.Text == "+" || label1.Text == "-" || label1.Text == "×" || label1.Text == "÷")
                {
                    label1.Text = null;
                }
                label1.Text = label1.Text + two;
                if (label1.Text.Length > 16)
                {
                    label1.Font = new Font(label1.Font.FontFamily, 13f, label1.Font.Style);
                }
                else
                {
                    label1.Font = new Font(label1.Font.FontFamily, 26f, label1.Font.Style);
                }
            }
            else
            {
                MessageBox.Show("字符长度超出范围");
            }
            if (num1 != null && symbol != null)
            {
                num2 = label1.Text;
                if (symbol == "+")
                {
                    rt = double.Parse(num1) + double.Parse(num2);
                    label2.Text = rt.ToString();
                }
                else if (symbol == "-")
                {
                    rt = double.Parse(num1) - double.Parse(num2);
                    label2.Text = rt.ToString();
                }
                else if (symbol == "×")
                {
                    rt = double.Parse(num1) * double.Parse(num2);
                    label2.Text = rt.ToString();
                }
                else if (symbol == "÷")
                {
                    rt = double.Parse(num1) / double.Parse(num2);
                    label2.Text = rt.ToString();
                }
            }
        }

        private void button14_Click(object sender, EventArgs e)
        {
            string three = "3";
            if (label1.Text.Length < 30)
            {
                if (label1.Text == "+" || label1.Text == "-" || label1.Text == "×" || label1.Text == "÷")
                {
                    label1.Text = null;
                }
                label1.Text = label1.Text + three;
                if (label1.Text.Length > 16)
                {
                    label1.Font = new Font(label1.Font.FontFamily, 13f, label1.Font.Style);
                }
                else
                {
                    label1.Font = new Font(label1.Font.FontFamily, 26f, label1.Font.Style);
                }
            }
            else
            {
                MessageBox.Show("字符长度超出范围");
            }
            if (num1 != null && symbol != null)
            {
                num2 = label1.Text;
                if (symbol == "+")
                {
                    rt = double.Parse(num1) + double.Parse(num2);
                    label2.Text = rt.ToString();
                }
                else if (symbol == "-")
                {
                    rt = double.Parse(num1) - double.Parse(num2);
                    label2.Text = rt.ToString();
                }
                else if (symbol == "×")
                {
                    rt = double.Parse(num1) * double.Parse(num2);
                    label2.Text = rt.ToString();
                }
                else if (symbol == "÷")
                {
                    rt = double.Parse(num1) / double.Parse(num2);
                    label2.Text = rt.ToString();
                }
            }
        }

        private void button13_Click(object sender, EventArgs e)
        {
            string add = "+";
            if (symbol == null && label1.Text.Length < 1 && num1 == null)
            {
                MessageBox.Show("无运算数字");
            }
            else
            {
                if (symbol == null)
                {
                    if (num1 == null)
                    {
                        num1 = label1.Text;
                    }
                    symbol = add;
                    label1.Text = symbol;
                    label2.Text = num1;
                }
                else
                {
                    if (label1.Text == "+" || label1.Text == "-" || label1.Text == "×" || label1.Text == "÷")
                    {
                        MessageBox.Show("您已输入运算符");
                    }
                    else
                    {
                        num2 = label1.Text;
                        num1 = rt.ToString();
                        symbol = add;
                        label1.Text = symbol;
                        label2.Text = rt.ToString();
                        num2 = null;
                    }
                }
            }
        }

        private void label2_Click(object sender, EventArgs e)
        {

        }

        private void label1_Click(object sender, EventArgs e)
        {

        }

        private void button20_Click(object sender, EventArgs e)
        {
            if (label1.Text.Length == 0)
            {
                MessageBox.Show("error");
            }
            else if (label1.Text == "+" || label1.Text == "-" || label1.Text == "×" || label1.Text == "÷")
            {
                MessageBox.Show("error");
            }
            else
            {
                double reserve = double.Parse(label1.Text);
                reserve = reserve / 100;
                label1.Text = reserve.ToString();
                if (num1 != null && symbol != null)
                {
                    num2 = reserve.ToString();
                    if (symbol == "+")
                    {
                        rt = double.Parse(num1) + double.Parse(num2);
                        label2.Text = rt.ToString();
                    }
                    else if (symbol == "-")
                    {
                        rt = double.Parse(num1) - double.Parse(num2);
                        label2.Text = rt.ToString();
                    }
                    else if (symbol == "×")
                    {
                        rt = double.Parse(num1) * double.Parse(num2);
                        label2.Text = rt.ToString();
                    }
                    else if (symbol == "÷")
                    {
                        rt = double.Parse(num1) / double.Parse(num2);
                        label2.Text = rt.ToString();
                    }
                }
            }
        }

        private void button19_Click(object sender, EventArgs e)
        {
            string zero = "0";
            if (label1.Text.Length < 30)
            {
                if (label1.Text == "+" || label1.Text == "-" || label1.Text == "×" || label1.Text == "÷")
                {
                    label1.Text = null;
                }
                label1.Text = label1.Text + zero;
                if (label1.Text.Length > 16)
                {
                    label1.Font = new Font(label1.Font.FontFamily, 13f, label1.Font.Style);
                }
                else
                {
                    label1.Font = new Font(label1.Font.FontFamily, 26f, label1.Font.Style);
                }
            }
            else
            {
                MessageBox.Show("字符长度超出范围");
            }
            if (num1 != null && symbol != null)
            {
                num2 = label1.Text;
                if (symbol == "+")
                {
                    rt = double.Parse(num1) + double.Parse(num2);
                    label2.Text = rt.ToString();
                }
                else if (symbol == "-")
                {
                    rt = double.Parse(num1) - double.Parse(num2);
                    label2.Text = rt.ToString();
                }
                else if (symbol == "×")
                {
                    rt = double.Parse(num1) * double.Parse(num2);
                    label2.Text = rt.ToString();
                }
                else if (symbol == "÷")
                {
                    rt = double.Parse(num1) / double.Parse(num2);
                    label2.Text = rt.ToString();
                }
            }
        }

        private void button18_Click(object sender, EventArgs e)
        {
            string dot = ".";
            int f=label1.Text.IndexOf(".");
            if(f == -1)
            {
                if(label1.Text.Length == 0)
                {
                    MessageBox.Show("error");
                }
                else if (label1.Text == "+" || label1.Text == "-" || label1.Text == "×" || label1.Text == "÷")
                {
                    MessageBox.Show("error");
                }
                else
                {
                    if (label1.Text.Length < 30)
                    {
                        label1.Text = label1.Text + dot;
                        if (label1.Text.Length > 16)
                        {
                            label1.Font = new Font(label1.Font.FontFamily, 13f, label1.Font.Style);
                        }
                        else
                        {
                            label1.Font = new Font(label1.Font.FontFamily, 26f, label1.Font.Style);
                        }
                    }
                    else
                    {
                        MessageBox.Show("字符长度超出范围");
                    }
                }
            }
            else
            {
                MessageBox.Show("error");
            }
        }

        private void button17_Click(object sender, EventArgs e)
        {
            if (symbol == null && label1.Text.Length < 1)
            {
                MessageBox.Show("无运算数字");
            }
            else
            {
                if (symbol == null)
                {
                    num1 = label1.Text;
                }
                else
                {
                    if (label1.Text != null)
                    {
                        if (label1.Text == "+" || label1.Text == "-" || label1.Text == "×" || label1.Text == "÷")
                        {
                            MessageBox.Show("error");
                        }
                        else
                        {
                            num2 = label1.Text;
                        }
                    }
                }
            }
            if (num2 != null)
            {
                if (symbol == "+")
                {
                    rt = double.Parse(num1) + double.Parse(num2);
                    label1.Text = rt.ToString();
                    label2.Text=null;
                    num1 = rt.ToString();
                    symbol = null;
                    num2 = null;
                }
                else if (symbol == "-")
                {
                    rt = double.Parse(num1) - double.Parse(num2);
                    label1.Text = rt.ToString();
                    label2.Text=null;
                    num1 = rt.ToString();
                    symbol = null;
                    num2 = null;
                }
                else if (symbol == "×")
                {
                    rt = double.Parse(num1) * double.Parse(num2);
                    label1.Text = rt.ToString();
                    label2.Text=null;
                    num1 = rt.ToString();
                    symbol = null;
                    num2 = null;
                }
                else if (symbol == "÷")
                {
                    rt = double.Parse(num1) / double.Parse(num2);
                    label1.Text = rt.ToString();
                    label2.Text=null;
                    num1 = rt.ToString();
                    symbol = null;
                    num2 = null;
                }
            }
        }
    }
}

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:/a/920365.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

python: generator model using sql server 2019

設計或生成好數據庫&#xff0c;可以生成自己設計好的框架項目 # encoding: utf-8 # 版权所有 &#xff1a;2024 ©涂聚文有限公司 # 许可信息查看 &#xff1a;言語成了邀功盡責的功臣&#xff0c;還需要行爲每日來值班嗎 # 描述&#xff1a; : 生成实体 # Author …

【Nginx从入门到精通】04-安装部署-使用XShell给虚拟机配置静态ip

文章目录 总结1、XShell &#xff1a;方便管理多台机器2、配置ip文件&#xff1a;区分大小写 一、查看上网模式二、Centos 7 设置静态ipStage 1 &#xff1a;登录root账号Stage 2 &#xff1a;设置静态ip : 修改配置文件 <font colororange>ifcfg-ens33Stage 2-1&#xf…

【深度学习】利用Java DL4J构建金融欺诈检测系统

&#x1f9d1; 博主简介&#xff1a;CSDN博客专家&#xff0c;历代文学网&#xff08;PC端可以访问&#xff1a;https://literature.sinhy.com/#/literature?__c1000&#xff0c;移动端可微信小程序搜索“历代文学”&#xff09;总架构师&#xff0c;15年工作经验&#xff0c;…

当你项目服务器磁盘报警

当你们公司运维收到这样的邮件&#xff0c;大概率日志文件过大引起的 在Linux下如何不停止服务,清空nohup.out文件呢&#xff1f; nohup.out会一直一直自己增长下去&#xff0c;如果你的服务器硬盘不给力的话&#xff0c;很容易把应用也挂掉&#xff08;硬盘没空间 &#xff0…

面向未来的智能视觉参考设计与汽车架构,思尔芯提供基于Arm技术的创新方案

引言&#xff1a; 随着科技的飞速发展&#xff0c;智能视觉IoT已成为科技领域的热门话题&#xff0c;为智能家居、智慧城市等领域带来新机遇。然而&#xff0c;物联网市场的碎片化特性对智能视觉芯片设计构成挑战。同时&#xff0c;汽车行业正经历技术驱动的变革&#xff0c;软…

C++ 20 中 vector list stack queue 分别从功能 效率等全方面分析其差异

C++ 20 中 vector list stack queue 分别从功能 效率等全方面分析其差异 在 C++20 中,std::vector、std::list、std::stack 和 std::queue 是常用的容器或容器适配器。以下从功能、效率、使用场景等方面对它们进行详细对比。 功能对比 2.效率对比 存储和访问 扩容效率std::…

51单片机之串口通讯

1.串口简介 串口&#xff0c;全称串行通信接口或串行通讯接口&#xff08;通常指COM接口&#xff09;&#xff0c;是一种常用于电子设备间通讯的全双工扩展接口。 串口通讯的技术基础&#xff0c;指一位一位地按顺序传送数据。其特点是线路简单&#xff0c;只需一对传输线&…

UE5 DownloadImage加载jpg失败的解决方法

DownloadImage加载jpg失败的解决方法 现象解决方案具体方法 现象 用UE自带的 DownloadImage 无法下载成功&#xff0c;从 failure 引脚出来。 接入一个由监控器自动保存起的图像&#xff0c;有些可以正常加载成功&#xff0c;有些无法加载成功。 经调查问题出现在&#xff0c;…

Springboot 整合 Java DL4J 搭建智能问答系统

&#x1f9d1; 博主简介&#xff1a;CSDN博客专家&#xff0c;历代文学网&#xff08;PC端可以访问&#xff1a;https://literature.sinhy.com/#/literature?__c1000&#xff0c;移动端可微信小程序搜索“历代文学”&#xff09;总架构师&#xff0c;15年工作经验&#xff0c;…

相较于发达国家约70%的普及率,中国【台式洗碗机】渗透率仅在2%-3%之间,潜在市场增量可观

内容摘要 据 HengCe 最新调研&#xff0c;2023年中国台式洗碗机市场销售收入达到了 万元&#xff0c;预计2030年可以达到 万元&#xff0c;2024-2030期间年复合增长率(CAGR)为 %。本研究项目旨在梳理台式洗碗机领域产品系列&#xff0c;洞悉行业特点、市场存量空间及增量空间&…

自动语音识别(ASR)与文本转语音(TTS)技术的应用与发展

&#x1f49d;&#x1f49d;&#x1f49d;欢迎来到我的博客&#xff0c;很高兴能够在这里和您见面&#xff01;希望您在这里可以感受到一份轻松愉快的氛围&#xff0c;不仅可以获得有趣的内容和知识&#xff0c;也可以畅所欲言、分享您的想法和见解。 推荐:kwan 的首页,持续学…

基于python的机器学习(四)—— 聚类(一)

目录 一、聚类的原理与实现 1.1 聚类的概念和类型 1.2 如何度量距离 1.2.1 数据的类型 1.2.2 连续型数据的距离度量方法 1.2.3 离散型数据的距离度量方法 1.3 聚类的基本步骤 二、层次聚类算法 2.1 算法原理和实例 2.2 算法的Sklearn实现 2.2.1 层次聚类法的可视化实…

算法知识-12-指针

概念 指针是一个变量&#xff0c;它存储的是另一个变量的内存地址。 基础使用指针 //声明 int* ptr; // 声明一个指向 int 类型的指针 //初始化 int num 5; int* ptr2 &num; // 使 ptr2 指向 num 的地址 //访问值 cout << *ptr2; // 输出 ptr2 所指向的 num …

图像上显示中文文本 - python 实现

该示例是在图像上显示中文文本&#xff0c;并用opencv的显示方式显示。 注意&#xff1a;SimHei.ttf&#xff08;黑体字体&#xff09;为字体文件&#xff0c;Windows 默认字体路径&#xff1a;C:/Windows/Fonts/SimHei.ttf 具体实现代码如下&#xff1a; # -*-coding:utf-8…

uniapp rpx兼容平板

问题: 使用uniapp开发平板端时, rpx/upx 内容过小, 没有适应屏幕 原因: uniapp 默认支持最大设备宽度为960px 而平板宽度超出了960 uniapp官方文档https://uniapp.dcloud.io/collocation/pages?idglobalstyle 解决: // pages.json 文件&#xff1a; {//..."globalSt…

【隐私计算大模型】联邦深度学习之拆分学习Split learning原理及安全风险、应对措施以及在大模型联合训练中的应用案例

Tips&#xff1a;在两方场景下&#xff0c;设计的安全算法&#xff0c;如果存在信息不对等性&#xff0c;那么信息获得更多的一方可以有概率对另一方实施安全性攻击。 1. 拆分学习原理 本文介绍了一种适用于隐私计算场景的深度学习实现方案——拆分学习&#xff0c;又称分割…

Java函数式编程基础之【Optional类】详解

一、概述 Optional 是 Java 8 引入的新特性&#xff0c;它是一种特殊的包装类&#xff0c;里面只存储一个元素&#xff08;这一点与基本数据类型的包装类有点相似&#xff09;。有的文档称其为容器类&#xff0c;但它不同于 Conllection框架中的集合类&#xff0c;它一个容器只…

stm32与ht7038的项目

最近做了一个stm32与ht7038的数据采集项目 硬件包含太阳能充电电路 ht7038采集芯片电路 buck电路 stm32最小系统电路和lora模块电路 硬件PCB如下图所示 ht7038的程序如下所示ht7038.c #include "ht7038.h" #include "stm32l0xx_hal_spi.h"typedef uint8…

AbsPlus框架介绍2

ABSPlus框架以其集成的多功能性在市场上脱颖而出。它不仅提供美观且符合主流风格的页面设计&#xff0c;还支持灵活的流程配置&#xff0c;包括算法处理流程和页面审批流程。在众多业务系统中&#xff0c;流程管理往往是核心且复杂的挑战&#xff0c;涉及数据库设计、页面开发以…

springboot基于微信小程序的食堂预约点餐系统

摘 要 基于微信小程序的食堂预约点餐系统是一种服务于学校和企事业单位食堂的智能化解决方案&#xff0c;旨在提高食堂就餐的效率、缓解排队压力&#xff0c;并优化用户的就餐体验。系统作为一种现代化的解决方案&#xff0c;为食堂管理和用户就餐提供了便捷高效的途径。它不仅…