摘要: using System;using System.Collections.Generic;using System.Text;using System.IO;using System.Net;using System.Threading;namespace Print.DownloadFile{ /// /// Http下载文件类 /// 支技断点续传功能 /// public class HttpDownloadFile { #region public delegate void DownloadIngHandler(o... 阅读全文
posted @ 2013-06-23 17:20 LS庆 阅读(348) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.Text;using System.Diagnostics;namespace ConsoleApplication3{ class Program { static void Main(string[] args) { // 关闭记事本的进程 CloseNotepad(); } /// /// 关闭记事本 /// ///... 阅读全文
posted @ 2013-06-23 16:46 LS庆 阅读(267) 评论(0) 推荐(0) 编辑
摘要: // --------------------------- // set default values for site // --------------------------- string Host = null; int Port = 21; string Login = ""; string Password = ""; string UploadDir = null; string NoModifyDir = "/"; int Timeo... 阅读全文
posted @ 2013-06-23 13:15 LS庆 阅读(257) 评论(0) 推荐(0) 编辑
摘要: 一、使用ManagementObjectSearcher类 static void Main(string[] args) { SelectQuery selectQuery = new SelectQuery("select * from win32_logicaldisk"); ManagementObjectSearcher searcher = new ManagementObjectSearcher(selectQuery); foreach (ManagementObject disk i... 阅读全文
posted @ 2013-06-23 13:06 LS庆 阅读(2555) 评论(0) 推荐(0) 编辑
摘要: #region /// /// 写日志文件,保存到指定的文件 /// /// 日志内容 /// 保存到文件 public static void WriterLog(string log, string fileName) { try { // System.Windows.Forms.MessageBox.Show(log); string logPath = System... 阅读全文
posted @ 2013-06-23 12:51 LS庆 阅读(421) 评论(0) 推荐(0) 编辑
摘要: /// /// 判断字符串是否为整数 /// /// /// public static bool IsNumeric(string str) { if (str.Trim() == "") { return false; } foreach (char ch in str) { if (ch 57) ... 阅读全文
posted @ 2013-06-23 12:49 LS庆 阅读(483) 评论(0) 推荐(0) 编辑
摘要: #region /// /// 加密原函数 /// /// /// /// public static string DesEncrypt(string pToEncrypt) { try { string sKey = "test123ok"; DESCryptoServiceProvider des = new DESCryptoServiceProv... 阅读全文
posted @ 2013-06-23 12:40 LS庆 阅读(353) 评论(0) 推荐(0) 编辑
摘要: #region 人民币小写金额转大写金额 /// /// 小写金额转大写金额 /// /// 接收需要转换的小写金额 /// 返回大写金额 public static string ConvertMoney(Decimal Money) { //金额转换程序 string MoneyNum = "";//记录小写金额字符串[输入参数] string MoneyStr = "";//记录大写金额字符串[输出... 阅读全文
posted @ 2013-06-23 00:29 LS庆 阅读(771) 评论(0) 推荐(0) 编辑
摘要: /// /// 定时清理内存 /// private void FulshMemory() { m_timer = new System.Threading.Timer(new TimerCallback(FulshMemory)); m_timer.Change(1000, 10000); } private void FulshMemory(object o) { ReduceMemory(); ... 阅读全文
posted @ 2013-06-23 00:24 LS庆 阅读(604) 评论(0) 推荐(0) 编辑
摘要: 1、// 判断该路径是文件还是文件夹,如果是文件夹if (File.GetAttributes(path).CompareTo(FileAttributes.Directory) == 0){ //DirectoryInfo dinfo = new DirectoryInfo(path); //dinfo.Delete(true); // 直接删除的方式,不会删除到回收站 Microsoft.VisualBasic.FileIO.FileSystem.DeleteDirectory(path, Microsoft.VisualBasic.FileIO.UIOption.A... 阅读全文
posted @ 2013-06-23 00:21 LS庆 阅读(2105) 评论(0) 推荐(0) 编辑
摘要: /// /// 添加到开机自动运行 /// public static void BootToRunAuto() { //获取可执行文件的全部路径 string exeDir = System.Windows.Forms.Application.ExecutablePath; //获取Run键 RegistryKey key1 = Registry.CurrentUser; RegistryKey ... 阅读全文
posted @ 2013-06-23 00:12 LS庆 阅读(290) 评论(0) 推荐(0) 编辑