会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
菜鸟程序猿
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
5
6
7
···
11
下一页
2023年11月7日
C# 防止程序重复启动,检查程序是否已经运行
摘要: 第一种方法:抓取程序的进程名,在系统已运行进程中检索该进程名是否已经存在 //获取欲启动进程名 string strProcessName = System.Diagnostics.Process.GetCurrentProcess().ProcessName; //检查进程是否已经启动,已经启动则
阅读全文
posted @ 2023-11-07 00:15 芈璐
阅读(3122)
评论(0)
推荐(0)
2023年11月4日
C# winform捕获程序异常内容
摘要: static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.ThreadException += Applicatio
阅读全文
posted @ 2023-11-04 23:31 芈璐
阅读(67)
评论(0)
推荐(0)
2023年11月3日
C# winform控件大小跟随窗体大小改变
摘要: int iFormWidth, iFormHeight;//初始窗体宽高 //窗体加载事件 private void Form1_Load(object sender, EventArgs e) { iFormWidth = this.Width;//初始宽 iFormHeight = this.H
阅读全文
posted @ 2023-11-03 20:31 芈璐
阅读(1023)
评论(0)
推荐(0)
C# 判断时间是否在指定时间段内,判断班别时间
摘要: protected bool getTimeSpan(string timeStr) { //判断当前时间是否在工作时间段内 string _strWorkingDayAM = "07:00"; string _strWorkingDayPM = "19:00"; TimeSpan dspWorki
阅读全文
posted @ 2023-11-03 19:37 芈璐
阅读(278)
评论(0)
推荐(0)
C# 发送邮件
摘要: using System.Net.Mail; MailMessage mmsg = new MailMessage(); mmsg.From = new MailAddress("");//发件邮箱地址 mmsg.To.Add("");//收件邮箱地址 mmsg.Subject = "";//邮件标
阅读全文
posted @ 2023-11-03 00:31 芈璐
阅读(29)
评论(0)
推荐(1)
C# 朗读消息,声音提示
摘要: using System.Speech.Synthesis; SpeechSynthesizer speech = new SpeechSynthesizer(); speech.Speak("");//同步 speech.SpeakAsync("");//异步
阅读全文
posted @ 2023-11-03 00:02 芈璐
阅读(68)
评论(0)
推荐(0)
2023年10月15日
C# 控制台应用中获取屏幕分辨率
摘要: 引用System.Management安装包。 using System.Management; ManagementObjectSearcher mydisplayResolution = new ManagementObjectSearcher("SELECT CurrentHorizontal
阅读全文
posted @ 2023-10-15 12:18 芈璐
阅读(178)
评论(0)
推荐(0)
2023年6月7日
安装Win11系统如何跳过联网步骤
摘要: 键盘按住shift+F10,会弹出cmd命令提示符框,然后输入: OOBE\BYPASSNRO 回车后重启系统选择“我没有Internet连接“即可。
阅读全文
posted @ 2023-06-07 21:26 芈璐
阅读(393)
评论(0)
推荐(0)
2023年3月4日
C#使用WinExec调用exe程序
摘要: 添加引用 using System.Runtime.InteropServices;//调用外部的DLL 定义DLL [DllImport("kernel32.dll")] public static extern int WinExec(string programPath, int operTy
阅读全文
posted @ 2023-03-04 17:12 芈璐
阅读(174)
评论(0)
推荐(0)
2023年2月22日
C# 实现模拟控制鼠标点击事件
摘要: /// <summary> /// 引用user32.dll动态链接库(windows api), /// 使用库中定义 API:SetCursorPos /// </summary> [DllImport("user32.dll")] private static extern int SetCu
阅读全文
posted @ 2023-02-22 10:39 芈璐
阅读(1051)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
···
11
下一页
公告