posts - 609,  comments - 13,  views - 64万
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

随笔分类 -  C#

C#获取设备型号
摘要:来源百度AI回答1. Windows系统在Windows系统上,你可以使用SystemInformation类(属于System.Windows.Forms命名空间)来获取一些基本的设备信息,例如制造商、型号等。但是,请注意,这种方法可能不会提供所有设备的详细型号信息。 using System; 阅读全文
posted @ 2025-02-14 13:14 邢帅杰 阅读(7) 评论(0) 推荐(0) 编辑
前端运行exe、bat
摘要:使用Cjwdev.WindowsApi /// <summary> /// 执行BAT(前端) /// 创建一个进程,并以指定的会话身份运行一个应用程序或命令。 /// 这对于需要模拟用户上下文或在特定权限下执行操作的应用程序特别有用。 /// </summary> /// <param name= 阅读全文
posted @ 2025-01-22 13:45 邢帅杰 阅读(7) 评论(0) 推荐(0) 编辑
C#执行cmd命令
摘要:private async void btnInstallPackage_Click(object sender, EventArgs e) { string msg = await Task.Run(() => { return executeCmd(); }); UpdateMsg(msg); 阅读全文
posted @ 2024-10-09 14:26 邢帅杰 阅读(20) 评论(0) 推荐(0) 编辑
c#启动EXE文件
摘要:xxx来源:http://t.zoukankan.com/TBW-Superhero-p-5570650.htmlhttp://t.zoukankan.com/flywing-p-10570063.html #region 安装程序 try { //D:\Demos\ConsoleApp1\Cons 阅读全文
posted @ 2022-12-30 10:08 邢帅杰 阅读(271) 评论(0) 推荐(0) 编辑
winform使用PrintDocument控件打印以及oledb驱动
摘要:代码,需要加入的控件:PrintDocument、PageSetupDialog、PrintDialog、PrintPreviewDialog、BackgroundWorker,控件的Document属性要指定为PrintDocument控件的id。导入Excel用的是12.0的驱动,需要下载:ht 阅读全文
posted @ 2019-01-04 12:34 邢帅杰 阅读(841) 评论(0) 推荐(0) 编辑
下载网络资源-带下载进度
摘要:带进度 http://t.zoukankan.com/h82258652-p-10950580.html namespace AppUtils { public struct HttpDownloadProgress { public long BytesReceived { get; set; } 阅读全文
posted @ 2018-12-29 12:58 邢帅杰 阅读(149) 评论(0) 推荐(0) 编辑
C#获取mp3文件时长、解决发布到服务器无法使用问题
摘要:首先引用COM组件:Microsoft Shell Controls And Automation,需要引用1.2版本的,1.0的会出问题。 这里需要注意DLL的属性Embed Interop Type 即 嵌入互操作类型 设为False,否则会引起互操作类型异常。 代码: 然后就要到发布了,但发布 阅读全文
posted @ 2017-01-20 16:18 邢帅杰 阅读(418) 评论(0) 推荐(0) 编辑
where(泛型类型约束)
摘要:在泛型类型定义中,where 子句用于指定对下列类型的约束:这些类型可用作泛型声明中定义的类型参数的实参。 例如,可以声明一个泛型类MyGenericClass,这样,类型参数 T 就可以实现 IComparable<T> 接口: public class MyGenericClass<T> whe 阅读全文
posted @ 2016-02-25 17:14 邢帅杰 阅读(342) 评论(0) 推荐(0) 编辑
把Excel作为数据库,读到DataTable中,Excel科学计数法数字转字符串
摘要:需要引用:using System.Data.OleDb; /// <summary> /// 获取Excel数据,包含所有sheet /// </summary> /// <param name="fullPath"></param> /// <returns></returns> public 阅读全文
posted @ 2016-01-12 18:55 邢帅杰 阅读(619) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示