摘要: 使用.Net2.0中的ConfigurationManager可以方便的实现对配置app.config的读取和写入。ConfigurationManager默认没有自动载入项目,使用前必须手动添加,方法如下:项目->引用->添加引用->选择System.configuration1.使用Config... 阅读全文
posted @ 2015-06-02 11:10 nieweiking 阅读(8527) 评论(0) 推荐(0) 编辑
摘要: 你可以在Windows计划任务管理器里面添加计划任务,调试OK后导出XML文件,然后在要部署的计算机上执行CMD导入命令,把计划任务信息配置导入到服务器上的计划任务列表中,命令如下:SCHTASKS /CREATE /XML C:\001.XML /TN "定时清理Chroma Mi 系统Logs"... 阅读全文
posted @ 2015-05-22 11:59 nieweiking 阅读(3690) 评论(0) 推荐(0) 编辑
摘要: C#对磁盘IO操作的时候,经常会用到这些,路径,文件,文件名字,文件扩展名. 之前,经常用切割字符串来实现, 可是经常会弄错. 尤其是启始位置,多少个字节,经常弄晕. 下面这种方法貌似比较简便: string filePath = @"E:\Randy0528\中文目录\JustTes... 阅读全文
posted @ 2015-05-21 17:00 nieweiking 阅读(6780) 评论(0) 推荐(0) 编辑
摘要: 1.WMI简介WMI是英文WindowsManagementInstrumentation的简写,它的功能主要是:访问本地主机的一些信息和服务,可以管理远程计算机(当然你必须要拥有足够的权限),比如:重启,关机,关闭进程,创建进程等。2.使用时首先添加System.Management.dll,然后... 阅读全文
posted @ 2015-05-21 15:40 nieweiking 阅读(1686) 评论(0) 推荐(0) 编辑
摘要: UI界面: test1 后端代码:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Wind... 阅读全文
posted @ 2015-05-21 13:11 nieweiking 阅读(394) 评论(0) 推荐(0) 编辑
摘要: private void treeView1_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs e) { //节点(是子节点或者是根节点) TreeViewItem item = treeVi... 阅读全文
posted @ 2015-05-21 13:05 nieweiking 阅读(3899) 评论(0) 推荐(0) 编辑
摘要: ServiceController service = new ServiceController("EnergyRecordService");protected void btnRestart_Click(object sender, EventArgs e) { try ... 阅读全文
posted @ 2015-05-20 14:48 nieweiking 阅读(1648) 评论(0) 推荐(0) 编辑
摘要: C# 判断文件是否被占用的三种方法using System.IO;using System.Runtime.InteropServices;[DllImport("kernel32.dll")]public static extern IntPtr _lopen(string lpPathName,... 阅读全文
posted @ 2015-05-20 14:27 nieweiking 阅读(18444) 评论(1) 推荐(4) 编辑
摘要: @echo off color 0atitle win7一键清理系统垃圾echo ★☆ ★☆ ★☆ ★☆ ★☆★☆★☆ ★☆ ★☆ ★☆ ★☆★echo ★☆ ★☆ ★☆ ★☆ ★☆★☆★☆ ★☆ ★☆ ★☆ ★☆★echo.★☆ ☆★echo.★☆ ☆★echo.★☆ 清理系统垃圾文件,请稍等..... 阅读全文
posted @ 2015-05-19 16:40 nieweiking 阅读(5505) 评论(0) 推荐(0) 编辑
摘要: 生产WCF客户端类文件的命令格式:svcutil.exe net.tcp://127.0.0.1:8732/ChromaMI.Remote.ConfigService/RemoteConfigService/mex /ct:System.Collections.Generic.List`1 阅读全文
posted @ 2015-05-19 16:37 nieweiking 阅读(187) 评论(0) 推荐(0) 编辑