随笔分类 -  c#知识点

上一页 1 2 3 4 5 6 7 8 9 ··· 16 下一页
摘要:C#中截取字符串某个字符之前的字符,可以通过以下几种实现方法: 1、使用 Substring 方法:可以使用字符串的 Substring 方法根据指定字符的位置来截取字符串。例如,假设要截取字符串中第一个等号之前的字符,代码如下: string str = "Hello=World"; int in 阅读全文
posted @ 2024-04-23 14:41 yinghualeihenmei 阅读(3269) 评论(0) 推荐(1) 编辑
摘要:数根又称数字根,是自然数的一种性质,每个自然数都有一个数根。对于给定的自然数,反复将各个位上的数字相加,直到结果为一位数,则该一位数即为原自然数的数根。 代码: public class Solution { public int AddDigits(int num) { while (num >= 阅读全文
posted @ 2024-04-17 21:34 yinghualeihenmei 阅读(34) 评论(0) 推荐(0) 编辑
摘要:在C#中,可以使用string类的ToUpper()和ToLower()方法来实现大小写的转换。 阅读全文
posted @ 2024-04-17 21:21 yinghualeihenmei 阅读(15) 评论(0) 推荐(0) 编辑
摘要:c#求绝对值在C#中,可以使用以下不同的方法来求绝对值: 方法一:使用Math.Abs()函数 int num = -10;int absValue = Math.Abs(num);Console.WriteLine(absValue); // 输出:10方法二:使用条件表达式 int num = 阅读全文
posted @ 2024-04-17 21:08 yinghualeihenmei 阅读(1231) 评论(0) 推荐(0) 编辑
摘要:原文链接:https://blog.csdn.net/weixin_45313952/article/details/114875545 b ? x : y ① 单个使用例: public static void main(String[] args) { int a = 2; int b = 3; 阅读全文
posted @ 2024-04-17 00:34 yinghualeihenmei 阅读(24) 评论(0) 推荐(0) 编辑
摘要:return new double[]{celsius+ 273.15,celsius * 1.80 + 32.00}; 阅读全文
posted @ 2024-04-17 00:22 yinghualeihenmei 阅读(7) 评论(0) 推荐(0) 编辑
摘要:原文链接:https://zhuanlan.zhihu.com/p/558000060?utm_id=0 1、流的含义: 流可以视为一组连续的一维数据,包含开头和结尾,并且其中的游标指示了流的当前位置。抽象基类 Stream支持读取和写入字节。 2、流涉及三个基本操作: 读取 :将数据从流传输到数据 阅读全文
posted @ 2024-04-10 11:45 yinghualeihenmei 阅读(506) 评论(0) 推荐(0) 编辑
摘要:原文链接:https://blog.csdn.net/nutian/article/details/2913670 https://blog.csdn.net/m0_58015531/article/details/131322801 WebClient类 如果只想从特定的URI请求文件,则可以使用 阅读全文
posted @ 2024-04-10 10:57 yinghualeihenmei 阅读(580) 评论(0) 推荐(0) 编辑
摘要:原文链接:https://blog.csdn.net/weixin_45763353/article/details/118005453 Button是按钮控件,具有按钮所有的属性和事件方法,在客户端被渲染为表单元素提交按钮。 Linkbutton是链接按钮,用于创建超链接样式的按钮。该控件的外观与 阅读全文
posted @ 2024-04-07 11:38 yinghualeihenmei 阅读(50) 评论(0) 推荐(0) 编辑
摘要:原文链接:https://blog.csdn.net/jk007/article/details/30251963 using ICSharpCode.SharpZipLib.Zip; public static void CompressDirectory(string iDirectory, s 阅读全文
posted @ 2024-04-07 10:56 yinghualeihenmei 阅读(23) 评论(0) 推荐(0) 编辑
摘要:原文链接:https://blog.csdn.net/weixin_45023644/article/details/121951840 C#的文件操作的功能是非常丰富的。他们大多来自System.IO类,比如:File、Directory、BinaryReader、BinaryWriter、Dir 阅读全文
posted @ 2024-04-07 10:24 yinghualeihenmei 阅读(128) 评论(0) 推荐(0) 编辑
摘要:原文链接:https://blog.csdn.net/qq_35970739/article/details/82887314 C#中Directory.GetFiles(string path , string searchPattern, SearchOption searchOption ) 阅读全文
posted @ 2024-04-03 14:57 yinghualeihenmei 阅读(4415) 评论(0) 推荐(0) 编辑
摘要:int[, ] arr = new int[2, 3]{ {1, 2, 3}, {4, 5, 6} }; // 可简写为 int[, ] arr = { {1, 2, 3}, {2, 4, 6} }; for (int i = 0; i < arr.GetLength(0); i++) { for 阅读全文
posted @ 2024-03-28 00:51 yinghualeihenmei 阅读(19) 评论(0) 推荐(0) 编辑
摘要:比如上面,意思是如果存在message,输出值为message,不存在即为默认值。 返回的值是一个结构体,调用这个方法,获取返回值,需要定义相同的结构体,才能正确的接受数据。 调用方法: 阅读全文
posted @ 2024-03-27 18:57 yinghualeihenmei 阅读(4) 评论(0) 推荐(0) 编辑
摘要:原文链接:https://blog.csdn.net/qq_45451847/article/details/120434797 JSON JSON序列化是将对象转换为JSON格式的字符串,而JSON反序列化是将JSON格式的字符串转换为对象。对于JSON大家都了解,JSON 是一种轻量级的文本数据 阅读全文
posted @ 2024-03-26 17:27 yinghualeihenmei 阅读(1811) 评论(1) 推荐(0) 编辑
摘要:以下为ai生成: System.Security.Cryptography.RijndaelManaged 是.NET框架中的一个加密类,用于提供高级加密标准(AES)算法的实现。AES是一种强大的对称加密算法,它可以用于保护数据的安全。 以下是一个使用RijndaelManaged进行数据加密和解 阅读全文
posted @ 2024-03-26 10:27 yinghualeihenmei 阅读(56) 评论(0) 推荐(0) 编辑
摘要:原文链接:https://blog.csdn.net/book_dw5189/article/details/132331397 System.Text.Encoding 是 C# 中用于处理字符编码和字符串与字节之间转换的类。它提供了各种静态方法和属性,用于在不同字符编码之间进行转换,以及将字符串 阅读全文
posted @ 2024-03-26 10:07 yinghualeihenmei 阅读(2236) 评论(0) 推荐(0) 编辑
摘要:原文链接:https://blog.csdn.net/lihongmao5911/article/details/132492916 在C#中,Math.Ceiling()是Math类方法。此方法用于查找最小整数,该整数大于或等于传递的参数。 Math类中的常用函数常规运算余数:IEEERemain 阅读全文
posted @ 2024-03-24 20:58 yinghualeihenmei 阅读(1584) 评论(0) 推荐(0) 编辑
摘要:Dictionary<string, string> dic1 = new Dictionary<string, string>(); dic1.Add("ddd","123"); dic1.Add("aaa", "123"); dic1.Add("ccc", "123"); dic1.Add("f 阅读全文
posted @ 2024-03-24 17:53 yinghualeihenmei 阅读(408) 评论(0) 推荐(0) 编辑
摘要:AI生成的答案,先记录下 升级C#版本通常是通过升级你的开发环境来实现的,例如Visual Studio。以下是升级C#版本的基本步骤: 确定你想要使用的C#版本。 确保你的开发环境支持该版本的C#。例如,Visual Studio 2019支持C# 8.0,Visual Studio 2022支持 阅读全文
posted @ 2024-03-24 11:47 yinghualeihenmei 阅读(1183) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 7 8 9 ··· 16 下一页
点击右上角即可分享
微信分享提示