摘要: public class RegisterHelp { /// <summary> /// CPU /// </summary> /// <returns></returns> public string GetCpu() { string strCpu = null; ManagementClas 阅读全文
posted @ 2020-07-08 17:20 be--yourself 阅读(461) 评论(0) 推荐(0) 编辑
摘要: 需要的Dll: NPOI.OOXML.dll https://files.cnblogs.com/files/CityOfThousandFires/NPOI.dl.rar /// <summary> /// Excel->DataTable /// </summary> /// <param na 阅读全文
posted @ 2020-07-08 17:13 be--yourself 阅读(567) 评论(0) 推荐(0) 编辑
摘要: #region 操作注册表 RegistryKey key = Registry.CurrentUser; string regPath = "software\\MyApp"; /// <summary> /// 创建注册表 /// 注意:注册表路径一定是"\\"而不是"\" /// </summ 阅读全文
posted @ 2020-07-08 17:04 be--yourself 阅读(264) 评论(0) 推荐(0) 编辑
摘要: 查询DataTable返回List List<string> listNation = dtNation.AsEnumerable().Select(d => d.Field<string>("MZMC").Trim()).Distinct().ToList(); 查询DataTable返回stri 阅读全文
posted @ 2020-07-08 16:58 be--yourself 阅读(1258) 评论(0) 推荐(0) 编辑
摘要: /// <summary> /// Excel->DataTable /// </summary> /// <param name="filePath">Excel文件路径</param> public static DataTable ReadExcel(string filePath) { IW 阅读全文
posted @ 2020-04-01 05:28 be--yourself 阅读(683) 评论(0) 推荐(1) 编辑
摘要: 实现鼠标移动到某个地区显示Popup弹框 1,地图 <Grid Margin="0,0,0,0" Grid.Row="1"> <Path Stroke="white" MouseEnter="Path_MouseEnter" MouseLeave="Path_MouseLeave" Tag="海南" 阅读全文
posted @ 2020-03-20 10:44 be--yourself 阅读(936) 评论(0) 推荐(0) 编辑
摘要: mysql与sql server都有整表导入的类库,但是查遍了资料发现sqlLite没有,除非自己去写个,发现用SQLiteTransaction导入数据也很快,附上代码 /// <summary> /// 导入major表数据 /// </summary> /// <param name="con 阅读全文
posted @ 2020-03-19 23:06 be--yourself 阅读(540) 评论(0) 推荐(0) 编辑
摘要: /// <summary> /// Excel->DataTable /// </summary> /// <param name="filePath">Excel文件路径</param> public static DataTable ReadExcel(string filePath) { IW 阅读全文
posted @ 2020-03-19 14:25 be--yourself 阅读(676) 评论(0) 推荐(0) 编辑
摘要: 效果图如下 代码 <DataGrid.Resources> <Style TargetType="{x:Type ScrollBar}"> <Setter Property="Stylus.IsPressAndHoldEnabled" Value="false"/> <Setter Property 阅读全文
posted @ 2020-03-08 21:13 be--yourself 阅读(1433) 评论(0) 推荐(0) 编辑
摘要: 在TCP/IP协议中,服务端需要去监听客户端的端口,开始监听,我们需要检测使用的端口是否被占用,获取系统当前使用的所有端口号,用此端口进行匹配即可。 代码如下 /// <summary> /// 检查端口,true表示已被占用 /// </summary> /// <param name="port 阅读全文
posted @ 2019-03-21 11:12 be--yourself 阅读(1673) 评论(1) 推荐(1) 编辑
摘要: 在Win10中运行VS不是默认以管理员程序运行的,需要手动设置 第一步:将VS快捷方式设置为以管理员身份运行 第二部 在C:\Program Files\Microsoft Visual Studio 12.0\Common7\IDE中找到devenv.exe 右键兼容性疑难解答-->疑难解答程序- 阅读全文
posted @ 2019-02-16 15:15 be--yourself 阅读(790) 评论(0) 推荐(0) 编辑
摘要: 在Windows服务里面启动其他具有界面的应用程序,需要穿透session隔离,尝试了很多种方法,都可行,现在一一列举下来,并写下几个需要注意的地方。 需要注意的地方 首先要将服务的Account属性设置为LocalSystem,安装服务后的登录身份则为本地系统账户 再一个需要注意的是不要把Wind 阅读全文
posted @ 2019-02-14 16:20 be--yourself 阅读(4352) 评论(5) 推荐(2) 编辑
摘要: 思路是首先新建一个vbs脚本,再创建一个bat脚本,再创建rdp文件,运行顺序是vbs->bat->rdp。rdp文件里面包含远程电脑的账密和其它信息,这样就可以不用再输入账密,而在程序里完成账密的设置,直接启动远程桌面(bat文件用vbs启动运行可以避免显示cmd的exe窗口),用C#语言写出这几 阅读全文
posted @ 2019-02-01 12:36 be--yourself 阅读(3923) 评论(1) 推荐(0) 编辑