![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
asp.net、C#相关
雨悟极
所有真正杰出的设计一旦被设计好,看起来都是那么的简单和显而易见。但是在获得杰出设计的过程中,需要付出令人难以置信的努力 -Michael Abrash
困知勉行,积厚成器
技术交流,与大家同行!
展开
-
C#的默认访问权限
1.在namespace中的类、接口默认是internal类型的,也可以显示的定义为public类型,不允许是其他访问类型。2.在一个类里面,属性和方法默认是private的,可以显示的定义为public、private、protected、internal或protected转载 2011-07-13 10:45:51 · 5513 阅读 · 0 评论 -
C# System.Reflection (反射)
在使用.NET创建的程序或组件时,元数据(metadata)和代码(code)都存储于“自成一体”的单元中,这个单元称为装配件。我们可以在程序运行期间访问这些信息。 在System.Reflection中有这样一个class————Assembly,我们可以通过它来加载一个装配件。方法如下: Assembly assm=Assembly.LoadFrom(fileName); 其中转载 2011-11-11 00:47:46 · 13810 阅读 · 0 评论 -
AES加密、解密算法 C#版
首先别忘了引用这个空间:using System.Security.Cryptography;参数是byte[]类型的: #region /// /// AES加密 /// /// 被加密的明文 /// 密钥 /// 向量 /// 密文 p转载 2011-11-11 15:34:14 · 15351 阅读 · 3 评论 -
C# System.Attribute (中括号)
本文以一个项目中通用的验证类来举例说明如何使用自定义Attribute来扩展元数据。 在项目中,我们为了保证各个层次之间的松藕合,通常把在各个层次之间传递数据的封装在一个称为实体类的类中,比如ActionFromusing System;namespace AttributeTest{ public class ActionForm { p转载 2011-11-11 00:57:08 · 10164 阅读 · 1 评论 -
Global.asax 文件是什么
Global.asax 文件,有时候叫做 ASP.NET 应用程序文件,提供了一种在一个中心位置响应应用程序级或模块级事件的方法。你可以使用这个文件实现应用程序安全性以及其它一些任务。下面让我们详细看一下如何在应用程序开发工作中使用这个文件。概述 Global.asax 位于应用程序根目录下。虽然 Visual Studio .NET 会自动插入这个文件到所有的 ASP.N转载 2011-12-01 09:52:33 · 1136 阅读 · 0 评论 -
如何为datagridview加上序号
using System;using System.Text;using System.Windows.Forms;using System.Drawing;namespace Test{ class DataGridViewEx : DataGridView { SolidBrush solidBrush; public转载 2011-04-13 15:21:00 · 802 阅读 · 0 评论 -
打开文件窗口、保存文件窗口、文件流的方法
打开文件窗口、保存文件窗口、文件流的方法,废话不多说,直接上码using System;using System.Data;using System.Windows.Forms;using System.Data.SQLite;using System.IO;using System.Diagnostics;namespace IpadDataConvert{原创 2011-11-25 11:23:40 · 943 阅读 · 0 评论 -
ToString()方法不是乱用的
用这个方法,首先要保证对象不能为null,另外,本身是string类型的就没必要用这样的方法,多余不是关键,关键是效率低下。执行下面的代码,你可以有所收货。 string str = "abcdefghigklmn"; string other = null; Stopwatch sw = Stopwatch.Sta转载 2011-11-24 17:14:52 · 598 阅读 · 0 评论 -
C#时间间隔计算
c# 时间比较|C#时间间隔计算c#事件比较直接可以用减法,即TimeSpan ts1 = DateTime.Now - DateTime.Now.AddDays(-1);它返回的是一个时间间隔。它有如下属性Days 获取当前 TimeSpan 结构所表示的时间间隔的天数部分。 Hours 获取当前 TimeSpan 结构所表示的时间间隔的小时数部分。 Milliseconds转载 2011-03-29 13:17:00 · 3367 阅读 · 0 评论 -
双表对比,获得新增、更新、删除数据的表,获得用于更新表的SQL语句方法
废话不多,先上码先 using System;using System.Text;using System.Data;namespace Method{ class Contrast { /// /// 对比表数据 /// /// 原表 /// 新表原创 2011-12-06 11:53:24 · 3171 阅读 · 0 评论