.net开发日常笔记(持续更新)

List<T>.Sort() → 排序T

List<T>.Find() → 找出一個T

List<T>.FindAll() →找出多個T

List<T>.Exist() →判斷T是否存在

----------------------END---------------------------

提示确定,例如删除等

cs 复制代码
//提示是否提交
                if (MessageBox.Show("请确认要替换码?", "码替换", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.No)
                {

                    return;
                }

----------------------END---------------------------

判断数据为空

cs 复制代码
if (string.IsNullOrEmpty(Xcode))
                {
                    MessageBox.Show("抱歉!当前任务扫码" + dqcode + "采集无数据1");
                    return;
                }

----------------------END---------------------------

cs 复制代码
//选中获取焦点
                    txtsonr.Select();
                    txtsonr.Focus();

----------------------END---------------------------

加载中.....提示

cs 复制代码
//测试弹窗 加载中

            LoaderForm.msg = "正在查询,请稍等..";
            SplashScreen.Show(typeof(LoaderForm));

            //Thread.Sleep(20);

            //END

            
            //关闭 提示
            try
            {
                SplashScreen.Close();
            }
            catch (Exception)
            {

            }	

涉及到几个类,源码打包下载地址如下:

https://download.csdn.net/download/li0531/89682541

----------------------END---------------------------

//文件不存在

cs 复制代码
//文件不存在
                if (!File.Exists(Yfile))
                {
                    MessageBox.Show("NN");
                }

----------------------END---------------------------

//调用系统默认的浏览器

cs 复制代码
//调用系统默认的浏览器   
System.Diagnostics.Process.Start("explorer.exe", "https://blog.csdn.net/li0531");

----------------------END---------------------------

获取当前程序地址

cs 复制代码
string path = $"{Application.StartupPath}\\label.btw";

----------------------END---------------------------

相关推荐
hez20108 小时前
.NET 11 Runtime Async 详解
c#·.net·.net core
猿长大人10 小时前
C# | Serilog 新手入门
开发语言·c#·.net·log
猿长大人19 小时前
C# | Autofac 新手指南:从零理解依赖注入与组件装配
c#·.net·di·依赖注入
半亩码田2 天前
【.NET新特性·第10篇】.NET 10 概览:LTS 版本的全面进化
大数据·.net
回忆2012初秋3 天前
.NET 中 TAP:构建健壮后台任务(BackgroundService)的完全指南(二)
网络·.net
猿长大人3 天前
C# | MediatR 入门指南:后端架构解耦
分布式·后端·架构·c#·.net
海盗12343 天前
微软技术日报——2026-08-06
人工智能·microsoft·.net
猿长大人4 天前
C# | 函数式编程入门
开发语言·c#·.net
L歪歪君 山水甲天5 天前
Office文件的奥秘——.NET平台下不借助Office实现Word、Powerpoint等文件的解析(1)
word·powerpoint·.net