在 Visual Studio 上体验腾讯云 AI 代码助手

​本文以以 Visual Studio 2022 为例。

第一步 安装[腾讯云 AI 代码助手]

打开以 Visual Studio 2022,依次点击工具栏中的-** 扩展 - ** 管理扩展 ,在扩展管理器 中搜索**[腾讯云 AI 代码助手]**,点击安装,然后重启VS

第二步 重启Visual Studio

重启VS,会提示安装[腾讯云 AI 代码助手]插件,等待插件安装完成,安装插件过程中需要关闭打开的所有VS项目



第三步 代码测试

腾讯云 AI 代码助手\]不在扩展中,需要在工具栏的**\[工具\]**中可以看到\[腾讯云 AI 代码助手\],打开\[腾讯云 AI 代码助手\]的快捷键为\*\* ALT + T\*\* ![](https://img2024.cnblogs.com/blog/1665523/202502/1665523-20250227114312009-1621057689.png) ##### 1、输入问题 比如写一个冒泡排序,在左下方可以切换混元和deepseek。 ##### 2、给出答案 ```csharp using System; class Program { static void BubbleSort(int[] arr) { int n = arr.Length; for (int i = n - 1; i > 0; i--) { bool swapped = false; for (int j = 0; j < i; j++) { if (arr[j] > arr[j + 1]) { // 交换 arr[j] 和 arr[j + 1] int temp = arr[j]; arr[j] = arr[j + 1]; arr[j + 1] = temp; swapped = true; } } // 如果没有发生交换,说明数组已经有序,提前退出 if (!swapped) break; } } static void Main(string[] args) { int[] data = { 64, 34, 25, 12, 22, 11, 90 }; Console.WriteLine("排序前的数组:"); foreach (int num in data) { Console.Write(num + " "); } Console.WriteLine(); BubbleSort(data); Console.WriteLine("排序后的数组:"); foreach (int num in data) { Console.Write(num + " "); } } } ``` ##### 3、执行代码 代码复制到类文件中调整下位置,运行代码,正确输出,没什么问题,代码内容测试只写一个这一个提问,其他大同小异 ![](https://img2024.cnblogs.com/blog/1665523/202502/1665523-20250227114813717-998309872.png) ## 使用上的建议: ① 在没指定开发语言的情况下,默认给出了Python的代码,这里最好在适配VS中可以默认回答代码语言为C#,这样使用体验上比较友好 ② 代码给出后,可以像在网页版一样复制代码,这里还有一个优化建议,比如代码插入功能,鼠标选中指定区域,点击代码回答下方的代码插入功能可以直接将代码插入到指定区域,也是在使用体验上更加友好些 ③ 像其他AI代码助手安装后会显示在工具栏的 \*\* \[扩展\] **中,而\[腾讯云 AI 代码助手\]显示在工具栏的**\[工具\]\*\*中。这是有点不一样的地方,快捷键激活对话还是很方便的。

相关推荐
工藤新一OL1 小时前
把xml的格式从utf-8-bom转为utf-8
xml·c#·asp.net·.netcore·visual studio
无规则ai1 天前
C#入门实战:数字计算与条件判断
c#·visual studio
布伦鸽2 天前
Visual Studio 2010-.Net Framework 4.0-DevExpress安装
ide·.net·visual studio
布伦鸽2 天前
Visual Studio 2010-.Net Framework 4.0项目-NPOI安装
ide·.net·visual studio
西柚小萌新2 天前
【软件与环境】--Visual Studio2022安装教程
ide·visual studio
无规则ai4 天前
C#的开发环境(visual studio的下载安装、测试c#语言)
开发语言·c#·visual studio
点云SLAM6 天前
Windows CMD(命令提示符)中最常用的命令汇总和实战示例
windows·microsoft·visual studio·powershell·cmd命令提示符·bat文件·win环境批处理
✎ ﹏梦醒͜ღ҉繁华落℘7 天前
Visual Studio编译WPF项目生成的文件介绍
hadoop·wpf·visual studio
oioihoii8 天前
Visual Studio C++编译器优化等级详解:配置、原理与编码实践
java·c++·visual studio
楼田莉子8 天前
C++学习之STL学习:stack\queue\priority_queue
开发语言·c++·学习·算法·stl·visual studio