首页 > 编程语言 >使用Visual Studio实现.NET的应用程序设计

使用Visual Studio实现.NET的应用程序设计

时间:2023-09-07 19:23:13浏览次数:35  
标签:类库 int Text System Visual Studio using NET StuMis

1、首先当然是下载好Visual Studio软件啦!(2019版本)

2、新建一个名为StuMis的解决方案

3、在解决方案里面新建一个名为MK01的类库和一个名为MK02的类库

右键解决方案,选择新建项目,选择类库:

4、此时,其实StuMis并未引用到这两个类库

我们需要为StuMis引用到这两个类库:
右键引用,添加引用-->

打勾之后,点击确定:

5、查看是否成功引用

找到StuMis解决方案所在的文件目录,然后找到这个文件:

使用记事本方式打开它(记得提前启动一下奥):

引用成功!

6、编写具体的代码程序

点击按钮即可实现;

MK01:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MK01
{
    public class Class1
    {
        public int Add(int x,int y)
        {
            return (x + y);
        }
    }
}

Form1:

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 StuMis
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {

        }

        private void label1_Click(object sender, EventArgs e)
        {

        }

        private void textBox3_TextChanged(object sender, EventArgs e)
        {
            
        }

        private void button1_Click(object sender, EventArgs e)
        {
            int a = Convert.ToInt32(textBox1.Text);
            int b = Convert.ToInt32(textBox2.Text);

            textBox3.Text = Convert.ToString(a + b);
        }
    }
}

标签:类库,int,Text,System,Visual,Studio,using,NET,StuMis
From: https://www.cnblogs.com/liuzijin/p/17685816.html

相关文章

  • Kubernetes Dashboard 认证时间延长
    近日,有同事反馈登录KubernetesDashboard竟然容易失效,需要再次认证。希望我们可以设置更长的时间。首先我们查询资料得知默认的Token失效时间是900秒,也就是15分钟,这意味着你每隔15分钟就要认证一次。//Expirationtime(inseconds)oftokensgeneratedbydashboard.Defaul......
  • .net core 请求网页的时候出现gzip压缩 respones返回的中文数据变成乱码
    解决方法:https://blog.csdn.net/lishenluo/article/details/105383323引用System.Text.Encoding.codePages包里面包含了解压缩转化中文gbkgb2312下面时具体的解压缩办法。publicstaticstringDecompressGzip(Streamstm){System.Text.Encoding.RegisterProvi......
  • .NET5学习笔记
    1、SDK 2、VS2019落落安装出错:网络-以太网-更改适配器网站-修改协议 安装板块:Web安装......
  • Kubernetes Components
    KubernetesComponentsWhenyoudeployKubernetes,yougetacluster.AKubernetesclusterconsistsofasetofworkermachines,callednodes,thatruncontainerizedapplications.Everyclusterhasatleastoneworkernode.Theworkernode(s)hostthePods......
  • kubernetes deploy standalone mysql demo
    kubernetes集群内部署单节点mysqlansibleall-mshell-a"mkdir-p/mnt/mysql/data"catmysql-pv-pvc.yamlapiVersion:v1kind:PersistentVolumemetadata:name:mysql-pv-volumelabels:type:localspec:storageClassName:manualcapacity:s......
  • rke2 在线部署 kubernetes
    文章目录1.还原虚拟机2.背景3.介绍4.预备条件5.1配置网卡5.配置主机名6.配置互信7.安装ansible8.系统初始化9.kube-master01部署9.1定制配置文件(可选)9.2部署9.3命令配置9.4检查节点10.配置其他管理节点11.Agent节点配置12.检查集群13.配置管理工具14.卸载1......
  • .net 调用Open CV 寻找并读取单据条码
    0、背景公司物流和财务部门想要把纸质单据做电子归档,需要识别单据上的二维码,拍照后保存到归档系统。1、软件模块1、WPF客户端对接高拍仪驱动,控制拍照读取图片使用opencv处理图片,寻找二维码块使用二维码读取api读取二维码内容上传图片和二维码数据到服务器2、webapi后端图片上传......
  • 【错误记录】Android Studio 创建 Module 模块报错 ( Cannot resolve external depend
    文章目录一、报错信息二、解决方案目前使用的是最新的Gradle配置,创建Module生成的源码与Gradle配置出现了冲突,导致的问题;解决此类问题,要仔细检查Gradle构建脚本,排查每个依赖库的来源;本次错误就是AS系统自动成的Module修改了Gradle构建脚本,导......
  • Kubernetes快速进阶与实战:构建可靠的容器化应用平台
    ......
  • net core读取配置节
    通过工具类 AppSettingsConfig services.AddSingleton(newAppSettingsConfig(configuration)); usingMicrosoft.Extensions.Configuration;usingSystem;usingSystem.Collections.Generic;usingSystem.Linq;usingSystem.Text;namespaceXXXXX.Common{......