随笔分类 - 代码收藏
摘要:///<summary> /// equiv of PHP's var dump for an object’s properties because i cbf writing all the properties out. ///</summary> ///<param name="info"></param> private static string var_dump(object info) { StringBuilder sb = new StringBuilder(); Type t = info.Get
阅读全文
摘要:出处:http://blogs.thesitedoctor.co.uk/tim/2010/02/27/Collapse+All+Solution+Explorer+Items+In+Visual+Studio+2010.aspxImports SystemImports EnvDTEImports EnvDTE80Imports EnvDTE90Imports System.Diagnostics'-----------------------------------------------------------' CollapseAll Module'-------
阅读全文
摘要:public class ExportDataGirdViewToExcel { /// <summary> /// 将DataGirdView数据,导出EXCEL文件。需要下载 MyXls。 /// 代码摘自 http://topic.csdn.net/u/20101231/09/039bdd22-3f0a-4bbb-908e-d887b4d7bbfe.html?19933 /// </summary> /// <param name="dgv">DataGridView控件名称</param> /// <param
阅读全文
摘要:public static class ProtectConfigFileUtil{ /// <summary> /// 加密配置节示例,加密 ConnectionStrings 和 AppSettings /// </summary> [Obsolete("这个方法只是示例")] public static void ProtectConnectionStringsAndAppSettings(HttpContext context) { Configuration config = WebConfigurationManager.OpenWebC
阅读全文
摘要:/// <summary> /// Form1 的构造函数 /// </summary> public Form1() { InitializeComponent(); this.Left = Screen.PrimaryScreen.WorkingArea.Right - this.Width; this.Top = Screen.PrimaryScreen.WorkingArea.Bottom - this.Height; }
阅读全文
摘要:摘自 csdn// 看了看别的资料有提取CPU,MAC的现成代码却没有硬盘序列号,找了好久才找到提取硬盘序列号的参数。于是自己给补上了。 <script> function disk() {//硬盘序列号 信息 var locator = new ActiveXObject ("WbemScripting.SWbemLocator"); var service = locator.ConnectServer("."); var properties = service.ExecQuery("SELECT * FROM Win32_D
阅读全文
摘要:/// <summary> /// ChunkHelper 帮助将序列分成若干块。 /// /// 如果 totalItemCount 是 11,chunkSize 是 5,则: /// chunk[0] 0, 1, 2, 3, 4 /// chunk[1] 5, 6, 7, 8, 9 /// chunk[2] 10 /// </summary> public class ChunkHelper { /// <summary> /// /// </summary> /// <param name="totalItemCount&q
阅读全文
摘要:using System;using System.Text;using System.IO;using System.Linq;public static partial class FileUtil{ #region 删除目录和文件 /// <summary> /// 删除目录及其下面的所有子目录和文件。如果目录有只读属性,则先去掉只读属性,然后删除。 /// </summary> /// <param name="path"></param> public static void DeleteDirectory(stri
阅读全文
摘要:use my_databasego--删除外键约束DECLARE c1 cursor forselect 'alter table ['+ object_name(parent_obj) + '] drop constraint ['+name+']; 'from sysobjectswhere xtype = 'F'open c1declare @c1 varchar(8000)fetch next from c1 into @c1while(@@fetch_status=0)beginexec(@c1)fetch next f
阅读全文
摘要:%SystemRoot%\Microsoft.NET\Framework\v2.0.50727\InstallUtil.exe /u pathpausepath 是 exe 文件的路径
阅读全文
摘要:using System;using System.Text;using System.Security.Cryptography;using System.IO;using System.Linq;//摘自 http://topic.csdn.net/u/20101231/09/039bdd22-3f0a-4bbb-908e-d887b4d7bbfe.html?19933#region 对称加密类 /// <summary> /// 对称加密解密类 /// </summary> public static class SymmetricEncryptClass { #
阅读全文
摘要:摘自http://topic.csdn.net/u/20101231/09/039bdd22-3f0a-4bbb-908e-d887b4d7bbfe.html?19933using System;using System.Text;using System.Security.Cryptography;/// <summary>/// 非对称加密类/// </summary>public static class AsymmetricEncrytClass{ #region 自动生成公钥、私钥方法 /// <summary> /// 自动生成非对称公钥、私钥
阅读全文
摘要:HttpResponse 的 Filter 属性是一个 Stream,通过重写这个流的方法,可以对 response 对象的输出进行修改。自定义 filter 时,如果直接从 Stream 派生新类,则必须要实现 Stream 的全部抽象方法,而实际应用中,只有 Write 方法才是创建过滤器时最关心的。这里的 HttpResponseFilter抽象类可以提供一点方便。 /// <summary> /// ResponseFilter 提供一个基类,从此类继承可以方便地创建筛选器类。 /// 子类只须实现 Write 方法,而不必费心于 Stream 类其他抽象方法的实现。 //
阅读全文
浙公网安备 33010602011771号