当前位置: 首页 > news >正文

Trae IDE新建C#工程

目录

1 结论

2 项目结构

3  项目代码


1 结论

新建C#工程来说,Trae的Chat比DeepSeek的Coder好用。

2 项目结构

MyWinFormsApp/

├── Program.cs
├── Form1.cs
├── Form1.Designer.cs
├── MyResources/
│   └── MyResources.resx
└── MyWinFormsApp.csproj

3  项目代码

根据AI提示反复迭代修改这几个文件,可以实现C#窗口程序的生成。

//Form1.csusing System;
using System.Windows.Forms;namespace MyWinFormsApp
{public partial class Form1 : Form{public Form1(){InitializeComponent();}private void Form1_Load(object sender, EventArgs e){// 使用 .resx 文件中的资源this.Text = MyWinFormsApp.MyResources.FormTitle;label1.Text = MyWinFormsApp.MyResources.WelcomeMessage;}}
}

//Form1.Designer.cs
namespace MyWinFormsApp
{partial class Form1{private System.ComponentModel.IContainer components = null;private System.Windows.Forms.Label label1;protected override void Dispose(bool disposing){if (disposing && (components != null)){components.Dispose();}base.Dispose(disposing);}private void InitializeComponent(){this.label1 = new System.Windows.Forms.Label();this.SuspendLayout();// // label1// this.label1.AutoSize = true;this.label1.Location = new System.Drawing.Point(100, 100);this.label1.Name = "label1";this.label1.Size = new System.Drawing.Size(100, 20);this.label1.TabIndex = 0;// // Form1// this.ClientSize = new System.Drawing.Size(300, 200);this.Controls.Add(this.label1);this.Name = "Form1";this.Load += new System.EventHandler(this.Form1_Load);this.ResumeLayout(false);this.PerformLayout();}}
}

//MyWinFormsApp.csproj
<Project Sdk="Microsoft.NET.Sdk"><PropertyGroup><OutputType>WinExe</OutputType><TargetFramework>net9.0-windows</TargetFramework><Nullable>enable</Nullable><UseWindowsForms>true</UseWindowsForms><EnableDefaultEmbeddedResourceItems>false</EnableDefaultEmbeddedResourceItems><EnableDefaultCompileItems>false</EnableDefaultCompileItems></PropertyGroup><ItemGroup><EmbeddedResource Include="MyResources\MyResources.resx"><Generator>PublicResXFileCodeGenerator</Generator><LastGenOutput>MyResources.Designer.cs</LastGenOutput></EmbeddedResource><Compile Include="Form1.cs" /><Compile Include="Form1.Designer.cs" /><Compile Include="Program.cs" /><Compile Include="MyResources\MyResources.Designer.cs"><DependentUpon>MyResources.resx</DependentUpon><AutoGen>True</AutoGen><DesignTime>True</DesignTime></Compile></ItemGroup>
</Project>

//Program.cs
using System;
using System.Windows.Forms;namespace MyWinFormsApp
{static class Program{[STAThread]static void Main(){Application.EnableVisualStyles();Application.SetCompatibleTextRenderingDefault(false);Application.Run(new Form1());}}
}

//MyResources/MyResources.Designer.cs
namespace MyWinFormsApp {using System;[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")][global::System.Diagnostics.DebuggerNonUserCodeAttribute()][global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]public class MyResources {private static global::System.Resources.ResourceManager resourceMan;private static global::System.Globalization.CultureInfo resourceCulture;[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]internal MyResources() {}[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]public static global::System.Resources.ResourceManager ResourceManager {get {if (object.ReferenceEquals(resourceMan, null)) {global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MyWinFormsApp.MyResources.MyResources", typeof(MyResources).Assembly);resourceMan = temp;}return resourceMan;}}[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]public static global::System.Globalization.CultureInfo Culture {get {return resourceCulture;}set {resourceCulture = value;}}public static string FormTitle {get {return ResourceManager.GetString("FormTitle", resourceCulture);}}public static string WelcomeMessage {get {return ResourceManager.GetString("WelcomeMessage", resourceCulture);}}}
}
//MyResources/MyResources.resx<?xml version="1.0" encoding="utf-8"?>
<root><xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"><xsd:element name="root" msdata:IsDataSet="true"><xsd:complexType><xsd:choice maxOccurs="unbounded"><xsd:element name="data"><xsd:complexType><xsd:sequence><xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /><xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /></xsd:sequence><xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" /><xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /><xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /></xsd:complexType></xsd:element></xsd:choice></xsd:complexType></xsd:element></xsd:schema><data name="FormTitle" xml:space="preserve"><value>我的窗体应用</value></data><data name="WelcomeMessage" xml:space="preserve"><value>欢迎使用!</value></data>
</root>

相关文章:

Trae IDE新建C#工程

目录 1 结论 2 项目结构 3 项目代码 1 结论 新建C#工程来说&#xff0c;Trae的Chat比DeepSeek的Coder好用。 2 项目结构 MyWinFormsApp/ │ ├── Program.cs ├── Form1.cs ├── Form1.Designer.cs ├── MyResources/ │ └── MyResources.resx └── MyWin…...

Linux基础--进程管理

目录 静态查看进程 使用命令: ps 动态查看进程 使用命令: top 关闭进程: 使用命令: kill 查看进程占用端口 使用命令: ss ​编辑 查看某端口是否被进程占用 使用命令: lsof 作业管理 进程后台运行: 使用命令: jobs 将后台进程调回前台 使用指令: fg 将前台进…...

Java面向对象(详细解释)

第一章 Static关键字 1.static的介绍以及基本使用 1.概述&#xff1a;static是一个静态关键字 2.使用&#xff1a; a.修饰一个成员变量&#xff1a; static 数据类型 变量名 b.修饰一个方法&#xff1a; 修饰符 static 返回值类型 方法名&#xff08;形参&#xff09;{…...

qt ui相关的第三方库插件库

Qt UI相关的第三方库和插件库有很多&#xff0c;能帮助开发者提高开发效率&#xff0c;扩展UI功能&#xff0c;增强可用性和美观度。以下是一些常见的第三方库和插件&#xff1a; 1. QCustomPlot 功能&#xff1a;用于在Qt应用程序中创建交互式的二维绘图。特点&#xff1a;支…...

详解动态规划算法

动态规划 一、动态规划的核心思想二、动态规划的步骤1. 定义状态&#xff08;State&#xff09;2. 确定状态转移方程&#xff08;State Transition Equation&#xff09;3. 确定边界条件&#xff08;Base Case&#xff09;4. 填表&#xff08;Table Filling&#xff09;或递归计…...

LINUX网络基础 [五] - HTTP协议

目录 HTTP协议 预备知识 认识 URL 认识 urlencode 和 urldecode HTTP协议格式 HTTP请求协议格式 HTTP响应协议格式 HTTP的方法 HTTP的状态码 ​编辑HTTP常见Header HTTP实现代码 HttpServer.hpp HttpServer.cpp Socket.hpp log.hpp Makefile Web根目录 H…...

慕慕手记项目日志 项目从开发到部署多环境配置 2025-3-8

慕慕手记项目日志 项目从开发到部署多环境配置 2025-3-8 现在是已经到了课程的第十章了&#xff0c;开始进行配置项目环境了。现在要完成的任务是项目可以正常运行&#xff0c;而且可以自由切换配置&#xff0c;开发/测试。 下面是当前的目录结构图&#xff1a; 现在来解释一…...

华为配置篇-OSPF基础实验

OSPF 一、简述二、常用命令总结三、实验3.1 OSPF单区域3.2 OSPF多区域3.3 OSPF 的邻接关系和 LSA 置底 一、简述 OSPF&#xff08;开放式最短路径优先协议&#xff09; 基本定义 全称&#xff1a;Open Shortest Path First 类型&#xff1a;链路状态路由协议&#xff08;IGP&…...

闭包:JavaScript 中的隐形大杀器

你可能已经在很多地方听说过闭包这个词&#xff0c;尤其是涉及到 JavaScript 的作用域和异步操作时。闭包是 JavaScript 中非常核心的概念&#xff0c;然而它又非常容易让开发者感到困惑。今天我们就来深入剖析闭包&#xff0c;帮助你真正理解它的工作原理&#xff0c;以及如何…...

【消息队列】数据库的数据管理

1. 数据库的选择 对于当前实现消息队列这样的一个中间件来说&#xff0c;具体要使用哪个数据库&#xff0c;是需要稍作考虑的&#xff0c;如果直接使用 MySQL 数据库也是能实现正常的功能&#xff0c;但是 MySQL 也是一个客户端服务器程序&#xff0c;也就意味着如果想在其他服…...

玩转ChatGPT:GPT 深入研究功能

一、写在前面 民间总结&#xff1a; 理科看Claude 3.7 Sonnet 文科看DeepSeek-R1 那么&#xff0c;ChatGPT呢&#xff1f; 看Deep Research&#xff08;深入研究&#xff09;功能。 对于科研狗来说&#xff0c;在这个文章爆炸的时代&#xff0c;如何利用AI准确、高效地收…...

Centos8部署mongodb报错记录

使用mongo ops安装mongodb6.0.4副本集报错 error while loading shared libraries: libnetsnmpmibs.so.35: cannot open shared object file: No such file or directory 解决 yum install net-snmp net-snmp-devel -y建议&#xff1a;初始化系统时把官网上的依赖包都装一遍 即…...

2024四川大学计算机考研复试上机真题

2024四川大学计算机考研复试上机真题 2024四川大学计算机考研复试机试真题 历年四川大学计算机考研复试机试真题 在线评测&#xff1a;https://app2098.acapp.acwing.com.cn/ 分数求和 题目描述 有一分数序列&#xff1a; 2/1 3/2 5/3 8/5 13/8 21/13… 求出这个数列的前 …...

前端面试题 口语化复述解答(从2025.3.8 开始频繁更新中)

背景 看了很多面试题及其答案。但是过于标准化&#xff0c;一般不能直接用于回复面试官&#xff0c;这里我将总结一系列面试题&#xff0c;用于自我复习也乐于分享给大家&#xff0c;欢迎大家提供建议&#xff0c;我必不断完善之。 Javascript ES6 1. var let const 的区别…...

更多文章请查看

更多文章知识请移步至下面链接&#xff0c;期待你的关注 如需查看新文章&#xff0c;请前往&#xff1a; 博主知识库https://www.yuque.com/xinzaigeek...

vulnhub靶场之【digitalworld.local系列】的vengeance靶机

前言 靶机&#xff1a;digitalworld.local-vengeance&#xff0c;IP地址为192.168.10.10 攻击&#xff1a;kali&#xff0c;IP地址为192.168.10.6 kali采用VMware虚拟机&#xff0c;靶机选择使用VMware打开文件&#xff0c;都选择桥接网络 这里官方给的有两种方式&#xff…...

MySql的安装及数据库的基本操作命令

1.MySQL的安装 1.1进入MySQL官方网站 1.2点击下载 1.3下拉选择MySQL社区版 1.4选择你需要下载的版本及其安装的系统和下载方式 直接安装以及压缩包 建议选择8.4.4LST LST表明此版本为长期支持版 新手建议选择红框勾选的安装方式 1.5 安装包下载完毕之后点击安装 2.数据库…...

中性点直接接地电网接地故障Simulink仿真

1.模型简介 本仿真模型基于MATLAB/Simulink&#xff08;版本MATLAB 2017Ra&#xff09;软件。建议采用matlab2017 Ra及以上版本打开。&#xff08;若需要其他版本可联系代为转换&#xff09; 2.系统仿真图&#xff1a; 3.中性点直接接地电网接地故障基本概念&#xff08;本仿…...

Linux16-数据库、HTML

数据库&#xff1a; 数据存储&#xff1a; 变量、数组、链表-------------》内存 &#xff1a;程序运行结束、掉电数据丢失 文件 &#xff1a; 外存&#xff1a;程序运行结束、掉电数据不丢失 数据库&#xff1a; …...

SpireCV荣获Gitee 最有价值开源项目称号

什么是GVP&#xff1f; GVP全称Gitee Valuable Project&#xff0c;意思为Gitee最有价值开源项目。作为GVP称号的获得者&#xff0c;SpireCV在开源社区中展现出了卓越的实力和影响力&#xff0c;为开源软件的发展和推广做出了积极的贡献。 这一荣誉不仅充分肯定了过去阿木实验…...

open-webui+deepseek api实现deepseek自由

虽然deepseek是免费的&#xff0c;但是官网的体验感太差。 所以才会有某种想法&#xff0c;想要更加舒服的使用deepseek。 1.Python虚拟环境 这个我就不多赘述&#xff0c;切记Python版本一定要和open-webui制定的版本一致。 2.deepseek api 去这个网站充点钱&#xff08;…...

Hadoop八股

Hadoop八股 HadoopMapReduce考点MR on Yarn 分布式工作原理shuffle&#xff1a;MapTask 和 ReduceTask的处理流程MR中的MapTask 和 ReduceTask 的数量决定MR和Spark两者Shuffle的区别简单讲一下map- reduce 原理**MapReduce 的核心概念****MapReduce 的工作流程****MapReduce 的…...

.NET Core全屏截图,C#全屏截图

.NET Core全屏截图&#xff0c;C#全屏截图 使用框架&#xff1a; WPF.NET 8 using System; using System.Collections.Generic; using System.Drawing; using System.Drawing.Imaging; using System.Linq; using System.Text; using System.Threading.Tasks; using System.W…...

ajax之生成一个ajax的demo示例

目录 一. node.js和express ​二. 使用express创建后端服务 三. 创建前端 一. node.js和express ajax是前端在不刷新的情况下访问后端的技术&#xff0c;所以首先需要配置一个后端服务&#xff0c;可以使用node.js和express。 首先生成一个空项目&#xff0c;新建main目录…...

软件工程笔记下

从程序到软件☆ 章节 知识点 概论☆ 软件的定义&#xff0c;特点&#xff0c;生存周期。软件工程的概论。软件危机。 1.☆软件&#xff1a;软件程序数据文档 &#xff08;1&#xff09;软件&#xff1a;是指在计算机系统的支持下&#xff0c;能够完成特定功能与性能的包括…...

【自学笔记】Numpy基础知识点总览-持续更新

提示&#xff1a;文章写完后&#xff0c;目录可以自动生成&#xff0c;如何生成可参考右边的帮助文档 文章目录 Numpy基础知识点总览目录1. 简介Numpy是什么为什么使用Numpy 2. 数组对象&#xff08;ndarray&#xff09;创建数组数组的属性数组的形状操作 3. 数组的基本操作数组…...

大模型gpt结合drawio绘制流程图

draw下载地址 根据不同操作系统选择不同的安装 截图给gpt 并让他生成drawio格式的&#xff0c;选上推理 在本地将生成的内容保存为xml格式 使用drawio打开 保存的xml文件 只能说效果一般。...

3.8【Q】cv

这个draw_line函数的逻辑和功能是什么&#xff1f;代码思路是什么&#xff1f;怎么写的&#xff1f; 这个t是什么&#xff1f;t.v[0]和t.v[1],[2]又是什么&#xff1f; void rst::rasterizer::draw(rst::pos_buf_id pos_buffer, rst::ind_buf_id ind_buffer, rst::Primitive ty…...

STM32F10XXX标准库函数及外设结构体

时钟 APB1 void RCC_APB1PeriphClockCmd(uint32_t RCC_APB1Periph, FunctionalState NewState)&#xff1a;使能或失能 APB1 时钟 参数 可赋值 描述 RCC_APB1Periph RCC_APB1Periph_TIM2 RCC_APB1Periph_TIM3 RCC_APB1Periph_TIM4 RCC_APB1Periph_TIM5 RCC_APB1Peri…...

计算机毕业设计SpringBoot+Vue.js车辆管理系统(源码+文档+PPT+讲解)

温馨提示&#xff1a;文末有 CSDN 平台官方提供的学长联系方式的名片&#xff01; 温馨提示&#xff1a;文末有 CSDN 平台官方提供的学长联系方式的名片&#xff01; 温馨提示&#xff1a;文末有 CSDN 平台官方提供的学长联系方式的名片&#xff01; 作者简介&#xff1a;Java领…...