首页 > 编程语言 >C#(1):各类应用程序

C#(1):各类应用程序

时间:2023-09-08 10:57:38浏览次数:34  
标签:C# Text void System 应用程序 Windows 各类 using public

一个解决方案下有多个项目时需要右键将该项目设置为默认启动方案


console程序:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
///控制台project
namespace ConsoleHelloWorld
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("HelloWorld");
        }
    }
}


WinForm:

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

namespace WinFormHelloWorld
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            textBoxShowHello.Text = "HelloWorld";
        }
    }
}


WpfHelloWorld

wpf可以使用类似html的界面设计

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace WpfHelloWorld
{
    /// <summary>
    /// MainWindow.xaml 的交互逻辑
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        private void textBoxShowHello_TextChanged(object sender, TextChangedEventArgs e)
        {

        }

        private void buttonSayHello_Click(object sender, RoutedEventArgs e)
        {
            textBoxShowHello.Text = "hello World";
        }
    }
}

ASP.NET Web Forms

发布网站


ASP.NET MVC

类似webforms的一种新的系统架构网站


 

 

标签:C#,Text,void,System,应用程序,Windows,各类,using,public
From: https://www.cnblogs.com/houyuxuan/p/17684991.html

相关文章

  • CF402D 题解
    2023-09-0418:42:46solution不难想到我们要先记录一下每一位的前缀\(\gcd\),我们发现我们选择一位的前缀\(\gcd\)除掉以后,前缀\(\gcd\)会变为\(1\)并且会导致这位之后的\(\gcd\)全部为\(1\)。所以每一位只能选择一次,并且我们从后往前扫肯定比从前往后扫要更优。我们......
  • CF1103C 题解
    2023-09-0514:52:07solution找路径很好找,我们随便跑个dfs树找个深度\(\ge\frac{n}{k}\)的路径输出即可。可是怎么找\(k\)个长度不是\(3\)的倍数的环呢?既然我们跑了dfs树,那么就没有横叉边,对于叶子节点非树边只有返祖边,然后一看这个很奇怪的条件——保证每个点度数大......
  • CF1851 部分题解
    2023-07-3019:35:02前言因为我实在是太菜了,没时间也不会做最后两题,所以这里只有前\(5\)道签到题的题解。之后我有时间看了后两题的题解再来更新吧~A先不用看那么多七七八八的,搞清楚下面几点即可:高度不能相同。高度差得被整除。高度差不能太大。好了,然后就可以\(AC\)......
  • C#_防止SQL注入的参数化格式Where条件
    publicclassWhereBuilder{privatereadonlyStringBuilder_whereBuilder=newStringBuilder();privatereadonlyList<SugarParameter>_parameter=newList<SugarParameter>();publicvoidAppend(strings)=>Append(s,null,null......
  • Tomcat架构学习
    1、Tomcat的两个核心功能:处理Socket连接,负责负责网络字节流与Request和Response对象的转化。加载和管理Servlet,以及处理具体Request请求。Tomct设计了两个核心组件连接器(Connector)和容器(Container)来分别做这两件事情。连接器负责对外交流,容器负责对内处理。单独的连接器或者容......
  • CF232B Table
    2023-08-0716:29:49题意有一个\(n\timesm\)的矩阵,求使得每个\(n\timesn\)的矩阵中都有正好\(k\)个点的方案数,方案数对\(1e9+7\)取模。\(1\len\le100,n\lem\le10^{18},0\lek\len^2\)。思路通过观察样例并且自己手玩了一些数据后,我们发现,假设第\(i\)列放了\(k\)......
  • 循环冗余校验(CRC)算法入门引导
    写给嵌入式程序员的循环冗余校验(CRC)算法入门引导前言CRC校验(循环冗余校验)是数据通讯中最常采用的校验方式。在嵌入式软件开发中,经常要用到CRC算法对各种数据进行校验。因此,掌握基本的CRC算法应是嵌入式程序员的基本技能。可是,我认识的嵌入式程序员中能真正掌握CRC算法的人却很少,......
  • mac mysql无法启动
    背景:在mac上装了mysql后无法启动,报错如下: 解决步骤:1.修改mysql配置文件,飘红的为修改部分(/usr/local/etc/my.cnf)#DefaultHomebrewMySQLserverconfig[mysqld]#Onlyallowconnectionsfromlocalhostbind-address=127.0.0.1#mysqlx-bind-address=127.0.0.1   #......
  • springboot - idea - active: @profileActive@ 有时候 不识别 @ 导致启动失败
    1.背景有时候正常,有时候不行,特别是maven执行了clean命令后 2.解决右键执行一下这个即可 ......
  • 学习使用双指针(leetcode)
    一、K和数对的最大数目(JAVA)给你一个整数数组nums和一个整数k。每一步操作中,你需要从数组中选出和为k的两个整数,并将它们移出数组。返回你可以对数组执行的最大操作数。示例1:输入:nums=[1,2,3,4],k=5输出:2解释:开始时nums=[1,2,3,4]:-移出1和4,......